UDFs in C++ and Java

Impala accepts UDFs and UDAFs written in C++, as well as Hive UDFs written in Java. A Java UDF may cause a query in Impala to run much slower than the equivalent native UDF written in C++. If you use Hive UDFs when you query Impala, the Hive UDFs must meet the following conditions:

  • Parameters and return values must all use data types that Impala accepts. Impala does not accept nested and composite types.
  • UDFs cannot accept or return the TIMESTAMP data type.
  • The return type must be a writable type, like Text or IntWritable. UDFs return a NULL value for Java primitive types, like string or int.
  • Impala does not accept Hive UDAFs or UDTFs.

For more information about Hive UDFs, refer to the Hive Language Manual UDF.