Reply
Explorer
Posts: 12
Registered: ‎12-07-2018

Get hive query by API or HDFS command

Hi,
I am trying to get Hive query and its details, But i can get its details not the full query. I need to get all the data by API or command, please give me an perfect solution asap.

 

Thanks,

Posts: 49
Topics: 0
Kudos: 13
Solutions: 5
Registered: ‎07-30-2018

Re: Get hive query by API or HDFS command

Hi,

 

You could get the full query string from "<jobID>_conf.xml" from Job history server

 

1. Job history server -> Click job ID-> Configuration -> Search for "hive.query.string"

2. From HDFS location -> "hdfs://<Hostname>:8020/user/history/done/2018/12/07/000000/<job_ID>_conf.xml -> search for "hive.query.string"

 

Hope it help. let us know if any questions.

 

Thanks
Jerry

Explorer
Posts: 12
Registered: ‎12-07-2018

Re: Get hive query by API or HDFS command

Thank you so much,

Is there a way to take all the users queries, users name,time of execution through API. Its is difficult to get all the xml file and extract its queries for one user, we have many users and there are several queries for the user. Even though I manage to get all the users query, the old query will get deleted. If i write a script, I want all the extracted queries and its username,time from the xml into a single file. So all the users, Query, uses name and time of execution will be in a single file.

Lets us consider a scenario that if I write a script like that, If a users has 5 xml and the script took all the query and the users details, If I execute again the new query only should append the file and not the old query.

Can you suggest any solution for my scenario?, please

Explorer
Posts: 12
Registered: ‎12-07-2018

Re: Get hive query by API or HDFS command

Is there a way to get job id and start and finished time from that xml file.

Highlighted
Explorer
Posts: 12
Registered: ‎12-07-2018

Re: Get hive query by API or HDFS command

Is there a way to get job id and start and finished time from that xml file.