0

I am writing a hive UDF in which I have to call an REST API and return an array of String. I have written the function with hardcoded REST API url. But now to make the endpoint configurable I want to take the host property out and put it in a config. Is it possible? If yes, then how can pass this?

mohit_d
  • 235
  • 2
  • 13

1 Answers1

0

Can you do change your UDF to take the host as part of its input, and then use variable substitution in Hive:

SET host=todayshosturl
SELECT TRANSFORM ${hiveconf:host}, line 
USING 'python myudf.py' AS (line)
FROM 
yourtable;
maxymoo
  • 35,286
  • 11
  • 92
  • 119