Hive jdbc执行seelct 语句时报 return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask

来源:互联网 发布:mac 命令查看运行程序 编辑:程序博客网 时间:2024/06/07 20:46
参考1
解决方法:
      对HIVE表进行条件过滤,必须要以partition为首要条件。
如:select distinct hdate from t_stage_access where hdate like '2014-07-%' and dt='2014-07-28'
hdate是partition。
不行


参考2
解决方式:用hive jdbc建表,用hive jdbc执行操作。

用hive shell建表,用hive jdbc执行操作可能会导致权限问题,引起以上两个错误。在删除原表,改用jdbc建表之后,异常解决了。

不行

最终找了我们的DBA,hive报错:

没有设置下队列,不允许提交到default队列中

2017-06-20T17:05:26,685ERROR [HiveServer2-Background-Pool: Thread-180955]: exec.Task(SessionState.java:printError(1038)) - Job Submission failed with exception'java.io.IOException(Failed

to run job : Userhduser1701 cannot submit applications to queue root.default)'

java.io.IOException:Failed to run job : User hduser1701 cannot submit applications to queueroot.default


原来是代码里没有指定队列,默认访问默认队列,没有权限                       

 //set queue

 stmt.execute(mysql[0]);

 res = stmt.executeQuery(mysql[1]);

Set mapreduce.job.queuename=queue_xxx_01;


完美解决。。。。
阅读全文
0 0
原创粉丝点击