天天看点

dw_odps_udtf_打包上传注册使用函数_200706dw_odps_udtf_打包上传注册使用函数

dw_odps_udtf_打包上传注册使用函数

IDEA写自定义函数->打jar包->dataworks上传资源->注册函数->引用函数

step1:IDEA写函数。在本地IDEA中写好用户自定义函数(UDF/UDTF/UDAF等)。

step2:打jar包。在IDEA中打成jar包。

注意:如果后续在DataWorks上跑时出现找不到依赖,可使用“with-dependencies”的jar包,把依赖一并打包。

dw_odps_udtf_打包上传注册使用函数_200706dw_odps_udtf_打包上传注册使用函数

step3:datastudio上传资源。登陆dataworks,在DataStudio数据开发工作台>业务流程>MaxCompute>资源>右键新建jar,上传jar包,提交且发布。注意:需勾选上上传为odps资源的钩子,否则odps上无该资源。

dw_odps_udtf_打包上传注册使用函数_200706dw_odps_udtf_打包上传注册使用函数

step4:注册函数。在DataStudio数据开发工作台>业务流程>MaxCompute>函数>右键新建函数,提交且发布。

dw_odps_udtf_打包上传注册使用函数_200706dw_odps_udtf_打包上传注册使用函数
dw_odps_udtf_打包上传注册使用函数_200706dw_odps_udtf_打包上传注册使用函数

step5:引用函数。新建odpssql节点,调用函数。

dw_odps_udtf_打包上传注册使用函数_200706dw_odps_udtf_打包上传注册使用函数