How to pass Hive conf variable in hive udf?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to pass hive conf variable to hive UDF. below is a code snippet. hive -f ../hive/testHive.sql -hivevar testArg=${testArg} Below is hive UDF call. select setUserDefinedValueForColumn(columnName,'${testArg}') from testTable; In udf I am getting value of testArg as null. Please advice me how to use hive conf variable in udf and how to access Hive configuration in hive UDF? 回答1: I think this is duplicate How to set variables in HIVE scripts You need to say ${hiveconf:testArg} 回答2: You can use GenericUDF. It has a method configure which