简体   繁体   English

如何在HIVE中运行查询时更改Tez作业名称

[英]How to change Tez job name when running query in HIVE

When I submit a Hive SQL using Tez like below: 当我使用Tez提交Hive SQL时,如下所示:

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 to my_job_nam ? 在资源管理器UI中,作业名称显示类似于HIVE-9d1906a2-25dd-4a7c-9ea3-bf651036c7eb有没有办法将作业名称更改为my_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 . 如果我没有使用Tez并在MR中运行作业,我可以使用set mapred.job.name设置作业名称。

Are there any Tez parameters I need to set, to change the job name? 我需要设置任何Tez参数来更改作业名称吗?

Any input is appreciated. 任何输入都表示赞赏。

You can use "set hiveconf hive.query.name=myjobname" 你可以使用“set hiveconf hive.query.name = myjobname”
But you will be able to see the name only in TEZ view. 但是您只能在TEZ视图中看到该名称。 Not in Yarn. 不是纱线。
See the link below: 请参阅以下链接:
https://community.hortonworks.com/questions/5309/how-to-set-tez-job-name.html 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. 如果我找到解决方案,我会更新问题。

Got this figured out. 得到了这个想法。 Using the property hive.session.id the name could be changed. 使用属性hive.session.id可以更改名称。 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;"

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; 在Spark上有一个针对Hive的JIRA,你要问的是一个非常相似的东西: HIVE-12811 - 你可以在那里使用spark.app.name; landing in Hive 2.1. 登陆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. 在Tez上找不到Hive特有的东西..也许有人需要提交类似于Hive-12811的Hive jira /补丁,但是对于Tez。

set hive.query.name="test_query"; set hive.query.name =“test_query”;

Will work in hive with TEZ 将与TEZ在蜂巢中工作

set mapred.job.name =更有用的名字

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM