[英]Can I use select query in aws redshift python udf function
How I can execute a select query in AWS Redshift UDF using plpythonu like oracle function with select into class in function like below.我如何在 AWS Redshift UDF 中使用类似 oracle 的 plpythonu 函数和 select into class in function 执行选择查询,如下所示。
CREATE OR REPLACE FUNCTION udf(id varchar(50))
RETURNS VARCHAR(50)
STABLE
AS $$
result = plpy.execute("SELECT count(*) FROM abc")
return result
$$ LANGUAGE plpythonu;
when I run above function i got following error.当我运行上面的函数时,出现以下错误。
ERROR: XX000: NameError: global name 'plpy' is not defined. Please look at svl_udf_log for more information
It's available on Postgresql ( https://www.postgresql.org/docs/9.2/static/plpython-database.html ).它在 Postgresql ( https://www.postgresql.org/docs/9.2/static/plpython-database.html ) 上可用。
At present, Amazon Redshift is not supported.目前,不支持 Amazon Redshift。
Same question like yours on this url: https://blogs.aws.amazon.com/bigdata/post/Tx1IHV1G67CY53T/Introduction-to-Python-UDFs-in-Amazon-Redshift与您在此网址上的问题相同: https : //blogs.aws.amazon.com/bigdata/post/Tx1IHV1G67CY53T/Introduction-to-Python-UDFs-in-Amazon-Redshift
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.