How to change Tez job name when running query in H

2020-03-02 10:39发布

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.

5条回答
Root(大扎)
2楼-- · 2020-03-02 10:59

Good question. There is a JIRA for Hive on Spark for a very similar thing that you're asking: HIVE-12811 - you could use spark.app.name there; landing in Hive 2.1.

Can't find anything specific for Hive on Tez.. perhaps somebody needs to submit a Hive jira/patch similar to Hive-12811 but for Tez.

查看更多
神经病院院长
3楼-- · 2020-03-02 10:59

set hive.query.name="test_query";

Will work in hive with TEZ

查看更多
▲ chillily
4楼-- · 2020-03-02 11:03

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.

查看更多
混吃等死
5楼-- · 2020-03-02 11:09

set mapred.job.name = more helpful name

查看更多
狗以群分
6楼-- · 2020-03-02 11:18

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;"
查看更多
登录 后发表回答