Why do I fail to delete the UDF using another service, for example, delete the UDF created by Hive using Spark SQL.
The UDF can be created using any of the following services:
The scenarios in which the UDF failed to be deleted may be as follows:
Cause: After the UDF is created, if the JDBCServer or the spark-sql has not been restarted, the newly created UDF will not be saved by the FunctionRegistry object in the thread where Spark locates. As a result, the UDF failed to be deleted.
Solution: Restart the JDBCServer and spark-sql of the Spark client and delete the UDF.
Cause: When you use a service to delete the UDF, the service will load the class that corresponds to the UDF to obtain the UDF. However, the .jar package is added by the add jar command and jar package does not exist in the classpath of other services. As a result, the ClassNotfound error occurs and the UDF failed to be deleted.
Solution: The UDF created using the preceding approach must be deleted using the same approach. No other approaches are allowed.