Unable to use an existing Hive permanent UDF from Spark SQL

前端 未结 2 1903
野性不改
野性不改 2021-02-03 23:41

I have previously registered a UDF with hive. It is permanent not TEMPORARY. It works in beeline.

CREATE FUNCTION normaliseURL AS \'com.example.hive         


        
2条回答
  •  执笔经年
    2021-02-04 00:33

    Issue is Spark 2.0 is not able to execute the functions whose JARs are located on HDFS.

    Spark SQL: Thriftserver unable to run a registered Hive UDTF

    One workaround is to define the function as a temporary function in Spark job with jar path pointing to a local edge-node path. Then call the function in same Spark job.

    CREATE TEMPORARY FUNCTION functionName as 'com.test.HiveUDF' USING JAR '/user/home/dir1/functions.jar'
    

提交回复
热议问题