Using UDF’s jar of Hive with Impala


I tried to use UDF’s jar of Hive with Impala, but ClassCastException has been thrown. I created a function reflect(string, string, string...) whose symbol is org.apache.hadoop.hive.ql.udf.generic.GenericUDFReflect class.

And log of Impala Daemon is the following:

So I looked into com.cloudera.impala.hive.executor.UdfExecutor and found that the symbol class must be extended org.apache.hadoop.hive.ql.exec.UDF. GenericUDFReflect does not extend UDF but GenericUDF.

I replaced classes which extend GenericUDF with ones which extend UDF. They looks like they work well. Let me show you some examples.

User-Defined Functions (UDFs)