Created on 01-06-2020 08:51 AM - last edited on 01-06-2020 01:13 PM by cjervis
Hi,
I'm looking to get the list of queries executed in the hive for the last 15 - 20 days can some one help me out on this.
Thanks!
Created 01-06-2020 12:04 PM
@Sambasivam Hive saves the last 100,00 lines into a file $HOME/.hivehistory. This may be a solution for this.
Also you can do some hack like running a grep on
cat ~/hive.log | grep "Starting command"
cat ~/hive.log | grep "Executing command"
Created 01-08-2020 07:41 AM
Another way of collecting the data is from yarn ATS through Rest API calls.Please have a look and frame your rest api calls to access the data.
Created 01-08-2020 07:52 AM
1. use Ranger Auditing for Hive to check the Query details run by a user. Hive does not store this detail in metastore.
https://docs.cloudera.com/HDPDocuments/HDP3/HDP-3.1.4/audit-ref/content/managing_auditing_in_ranger_...
2. You can use the below Query To get all the apps having states as FINISHED,KILLED by the specific user for specific time period
GET "http://Resource-Manager-Address:8088/ws/v1/cluster/apps?limit=20&states=FINISHED,KILLED&user=<user-id>&startedTimeBegin={time in epoch}&startedTimeEnd={time in epoch}"
3. Simply make use of Tez view if your execution Engine is Tez