我正在尝试在redshift中实现嵌套的udf。
select
custom_function(custom_function('', column1), column2)
from
table1
但是它说不支持嵌套udfs。有人可以帮我吗?
尝试使用答案中提到的python库方法,如下所示!
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))