The HiveModule provides Hive built-in functions as Flink system (built-in) functions to Flink SQL and Table API users.
For detailed information, please refer to HiveModule.
NOTE that some Hive built-in functions in older versions have thread safety issues.
We recommend users patch their own Hive to fix them.
Hive User Defined Functions
Users can use their existing Hive User Defined Functions in Flink.
Supported UDF types include:
Upon query planning and execution, Hive’s UDF and GenericUDF are automatically translated into Flink’s ScalarFunction,
Hive’s GenericUDTF is automatically translated into Flink’s TableFunction,
and Hive’s UDAF and GenericUDAFResolver2 are translated into Flink’s AggregateFunction.
To use a Hive User Defined Function, user have to
set a HiveCatalog backed by Hive Metastore that contains that function as current catalog of the session
include a jar that contains that function in Flink’s classpath
use Blink planner.
Using Hive User Defined Functions
Assuming we have the following Hive functions registered in Hive Metastore: