Hive variable demo

create table ori_trans (account string, maker string, tdate string) partitioned by (country string);

hive  -f test1.hql --hiveconf country='china'

hive  -f test2.hql --hiveconf country='china' --define account=account2 --define maker=yaoxiaohua

hive  -f test2.hql --hiveconf country='japan' --define account=account3 --define maker=yaoyuanyie

 insert overwrite table ori_trans partition(country='${hiveconf:country}') 
 select 
 '${account}' as account, '${maker}' as maker, '2012-03-03' 
 from nums limit 20;
 
 hive  -f test3.hql --define table_pre=china --define account=account3 --define maker=yaoyuanyie
 
 drop table ${table_pre}_ori_trans;
  create table ${table_pre}_ori_trans as
 select 
 '${account}' as account, '${maker}' as maker, '2012-03-03' 
 from nums limit 20;
 
 
issue1. hive query ‘s job 提交到yarn集群,但是状态一直是accepted,不能进入running.
解决方案:重启DFS服务。
issue2.hadoop yarn如何查看job执行情况?
http://jobtrackerip:8088/
http://jobtrackerip:50070
 
Looking for a job working at Home about MSBI
原文地址:https://www.cnblogs.com/huaxiaoyao/p/4367219.html