Hi,

When a hive query is submitted to hiveserver2 over JDBC, is there a way to get 
the Hadoop job id (and status) for the hive query?

The JDBC call "statement.execute(hiveQuery)" is a blocking call. Specifically, 
is there any way to execute a query on the same JDBC connection to from another 
thread know the job Id?

For now, I am following this approach: Before submitting the actual query, I 
execute the following on the same statement:
set mapred.job.name=myjob.<pid>.<currentTime>

Here <pid> is the process id of the submitting java process and <currentTime> 
is obtained using System.currentTimeMillis().

This sets the job name for the subsequent queries. I can then query the job Id 
for this job name using the JobClient and then I can monitor the job status 
using this job Id.

Let me know if there is a better way to proceed.

-Kiran

Reply via email to