To get full query running for the application id goto TEZ UI from ambari(there you can see query history)
Steps go to Tez view via ambari:-
1) From the Ambari home page, hover over the top right corner, and select "Tez View"
2) Next, you can either search by application ID or the hive query itself to find your application.
3) Select your application - the entire hive query should be displayed here and also you can see the status of the query.
(or) from hiveserver2.log
You can check hive.exec.scratchdir set in hive-site.xml to know hive query logs location but in general Hive Server2 logs are in /var/log/hive but to retrieve the query from there requires integration of Ambari + Tez.