我正在尝试在redshift中实现一个嵌套的udf。
select
custom_function(custom_function('', column1), column2)
from
table1 但它说嵌套的udf不受支持。有人能帮帮我吗?
我尝试使用答案中提到的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))发布于 2018-10-02 16:46:40
您必须将想要嵌套的UDF组织为Python库,并将该库导入到集群中,这是instruction
https://stackoverflow.com/questions/52600802
复制相似问题