beeline报错:return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

beeline报错:return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask,第1张

beeline报错:return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

执行

beeline -u jdbc:hive2://127.0.0.1:10000 -n root -p password -e "truncate table xxx;"

的时候报错:

 

Driver: Hive JDBC (version 2.1.1-cdh6.3.2)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Exception while processing (state=08S01,code=1)

一开始一头雾水,试了一下下面的语句发现竟然执行成功了

beeline -u jdbc:hive2://127.0.0.1:10000 -n root -p password -e "select * from xxx;"

初步怀疑是root用户的权限问题,遂

hive> show grant user root on database ods;
OK
Time taken: 0.04 seconds

hive> show grant user hive on database ods;
ERROR exec.DDLTask: org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthzPluginException: Error showing privileges: User : root is not allowed check privileges of another user : hive. User has to belong to ADMIN role and have it as current role, for this action.

果然没有权限

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5669284.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存