DLI allows you to create and use user-defined functions (UDF) and user-defined table functions (UDTF) in Spark jobs.
1 2 3 4 5 | CREATE FUNCTION [db_name.]function_name AS class_name [USING resource,...] resource: : JAR file_uri |
Or
1 2 3 4 5 | CREATE OR REPLACE FUNCTION [db_name.]function_name AS class_name [USING resource,...] resource: : JAR file_uri |
Create the mergeBill function.
1 2 | CREATE FUNCTION mergeBill AS 'com.xxx.hiveudf.MergeBill' using jar 'obs://onlyci-7/udf/MergeBill.jar'; |