ambari hive创建udf失败问题解决

问题描述:
Amabri 2.7.4 hive 3.1.0
hive Authorization用了默认 ,试过sqlstdauth也报错
在这里插入图片描述
hive执行添加udf命令报错

Error: Error while compiling statement:FAILED: HiveAccessControlException Permission denied:
Principal [name=root,type=USER] does not have following privileges for operation ......
> add jar /opt/hiveudf-1.0-SNAPSHOT.jar;
Error: Error while processing statement:
Failed to retrieve roles for root: Metastore Authorization api invocation for remote metastore is disabled in this configuration. 
Run commands via jdbc/odbc clients via HiveServer2 that is using embedded metastore. (state=,code=1)

可能add jar包成功 但是 创建自定义函数失败 报权限不够

>create function aisino.myUUID as 'aisino_udf.UUIDFunction' using jar 'hdfs:/user/hive/UUID.jar';
Error: Error while compiling statement: FAILED: HiveAccessControlException Permission denied: Principal [name=root, type=USER] does not have following privileges for operation CREATEFUNCTION [ADMIN PRIVILEGE on INPUT, ADMIN PRIVILEGE on OUTPUT] (state=42000,code=40000)

网上说set role admin 可是
set role admin

INFO  : Compiling command(queryId=hive_20210602141059_bbeb5c5b-bbf7-4917-8c0c-0e86811e228e): set role admin
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20210602141059_bbeb5c5b-bbf7-4917-8c0c-0e86811e228e); Time taken: 0.696 seconds
INFO  : Executing command(queryId=hive_20210602141059_bbeb5c5b-bbf7-4917-8c0c-0e86811e228e): set role admin
INFO  : Starting task [Stage-0:DDL] in serial mode
ERROR : FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Failed to retrieve roles for root: Metastore Authorization api invocation for remote metastore is disabled in this configuration. Run commands via jdbc/odbc clients via HiveServer2 that is using embedded metastore.

解决办法:
根据错误提示
。。。。。。 先关权限认证
在这里插入图片描述

在这里插入图片描述

おすすめ

転載: blog.csdn.net/weixin_41772761/article/details/117470025