文档首页> MapReduce服务 MRS> 故障排除> 使用Hive> 在beeline客户端创建UDF时报错
更新时间:2023-11-18 GMT+08:00
分享

在beeline客户端创建UDF时报错

问题现象

执行命令:

create function fn_test3 as 'test.MyUDF' using jar 'hdfs:///tmp/udf2/MyUDF.jar'

报以下错误:

Error: Error while compiling statement: FAILED: HiveAccessControlException Permission denied: Principal [name=admin, type=USER] does not have following privileges for operation CREATEFUNCTION [[ADMIN PRIVILEGE] on Object [type=DATABASE, name=default], [ADMIN PRIVILEGE] on Object [type=FUNCTION, name=default.fn_test3]] (state=42000,code=40000)

原因分析

Hive中创建永久函数需要特殊的role admin。

解决方案

在执行语句前执行set role admin命令即可解决。

分享:

    相关文档

    相关产品