An Error Is Reported When a UDF Is Created on the Beeline Client
Symptom
Run the following command:
create function fn_test3 as 'test.MyUDF' using jar 'hdfs:///tmp/udf2/MyUDF.jar'
The following error is reported:
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)
Cause Analysis
To create a permanent function in Hive, role admin is required.
Solution
Run the set role admin command before running the statement.
Parent topic: Using Hive
- Symptom
- Cause Analysis
- Solution