I am trying to implement a nested udf in redshift.
select
custom_function(custom_function('', column1), column2)
from
table1
But it says nested udfs are not supported. can someone help me here?
Tried using the python library approach mentioned in the answer and its shown below!!
class f_string:
def __init__(self, current_value, key, value):
self.current_value = current_value
self.key = key
self.value = value
def f_make_json(self):
import json
current_value = json.loads(self.current_value)
self.value.replace('"', '\"')
current_value[self.key] = self.value
return (json.dumps(current_value))