Hive---User test cannot submit applications to queue root.default
场景:
hive:2.6
系统:CentOS6.8
直接在系统用户下执行hive进入hive环境执行语句
$ hive
$ select id,name,phone,adree,lag(......) from tb_dept_sub limit 5;
报错信息如下:
Failed to submit application_1xxxx to YARN : User test cannot submit applications to queue root.default)'
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
重点信息如下: User test cannot submit applications to queue root.default ...
翻译:test用户不能提交应用到root的默认队列
但执行下面的可以执行成功
$ select id,name,phone,adree from tb_dept_sub limit 5;
解决:
一般情况下,不指定队列信息的话,会使用默认的root.default队列,但普通用户有时并没有太多的权限使用该队列,
而且一般建议用户自己自定义一个队列。
上面使用到了lag函数,这时候hive会通过MR访问hdfs,当不使用lag函数时,猜测走的是直接读取hdfs文件,并没有走MR(只是猜测,并没有实测!)
设置队列
$ set mapreduce.job.queuename=test_queue1;
再次执行报错语句
$ select id,name,phone,adree,lag(......) from tb_dept_sub limit 5;