Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Tez job name when running query in HIVE

When I submit a Hive SQL using Tez like below:

hive (default)> select count(*) from simple_data;

In Resource Manager UI the job name shows something like HIVE-9d1906a2-25dd-4a7c-9ea3-bf651036c7eb Is there a way to change the job name tomy_job_nam?

If I am not using Tez and running the job in MR, I can set the job name using set mapred.job.name.

Are there any Tez parameters I need to set, to change the job name?

Any input is appreciated.

like image 241
khussain Avatar asked Oct 29 '15 19:10

khussain


2 Answers

You can use "set hiveconf hive.query.name=myjobname"
But you will be able to see the name only in TEZ view. Not in Yarn.
See the link below:
https://community.hortonworks.com/questions/5309/how-to-set-tez-job-name.html

I`m looking into this issue also. If I find the solution I update the question.

like image 107
Glib Martynenko Avatar answered Jan 04 '23 00:01

Glib Martynenko


Got this figured out. Using the property hive.session.id the name could be changed. Below is an example.

hive --hiveconf hive.session.id=test_$(date '+%Y%m%d_%H%M%S') \
      -e "select month, max(sale) from simple_data group by month;"
like image 39
khussain Avatar answered Jan 03 '23 22:01

khussain