Help Center/ MapReduce Service/ User Guide (ME-Abu Dhabi Region)/ Troubleshooting/ Using Hive/ "Invalid function" Is Displayed When a UDF Is Used
Updated on 2022-02-22 GMT+08:00

"Invalid function" Is Displayed When a UDF Is Used

Symptom

When a UDF is created on the Hive client using Spark, "Error 10011" indicating "invalid function" is reported:

Error: Error while compiling statement: FAILED: SemanticException [Error 10011]: Line 1:7 Invalid function 'test_udf' (state=42000,code=10011)

The preceding problem occurs when multiple HiveServers use a UDF. For example, if metadata is not synchronized in time when the UDF created on HiveServer2 is used on HiveServer1, the preceding error is reported when clients on HiveServer1 are connected.

Cause Analysis

Metadata shared by multiple HiveServers or Hive and Spark is not synchronized, causing memory data inconsistency between different HiveServer instances and invalid UDF.

Solution

Synchronize new UDF information to HiveServer and reload the function.