In pig, you can pass a configuration from your pig script to pig UDF via UDFContext
. For example,
// in pig script
SET my.conf dummy-conf
// in UDF java code
Configuration conf = UDFContext.getUDFContext().getJobConf();
String myConf = conf.get("my.conf");
So, is there a similar way to pass configuration from a hive script to a hive UDF? For example, if I have set MY_CONF='foobar'
in a hive script, how can I retrieve that in a java UDF, which needs to consume the value of MY_CONF
?