简体   繁体   English

AWS Redshift UDF错误

[英]AWS Redshift UDF Error

I am trying to implement Redshift UDFs. 我正在尝试实现Redshift UDF。 It should be straightforward according to the docs: http://docs.aws.amazon.com/redshift/latest/dg/udf-creating-a-scalar-udf.html 根据文档,它应该很简单: http : //docs.aws.amazon.com/redshift/latest/dg/udf-creating-a-scalar-udf.html

However, when I try to execute the example, Redshift returns ERROR: User Defined Function is not supported. 但是,当我尝试执行该示例时,Redshift返回ERROR: User Defined Function is not supported.

I am running as the cluster root user and just for good measure I granted myself usage on the python language with GRANT USAGE ON LANGUAGE plpythonu TO USER_NAME_HERE; 我正在以集群root用户身份运行,并且出于良好的考虑,我使用GRANT USAGE ON LANGUAGE plpythonu TO USER_NAME_HERE;授予了自己在python语言上的使用权限GRANT USAGE ON LANGUAGE plpythonu TO USER_NAME_HERE;

For completeness, here is the example I ran from the docs: 为了完整起见,这是我从文档运行的示例:

create function f_greater (a float, b float)
  returns float
stable
as $$
  if a > b:
    return a
  return b
$$ language plpythonu;

Any thoughts on fixing the error? 对解决错误有任何想法吗? Does it work for anyone else? 它对其他人有用吗?

Looks like your cluster just haven't been patched yet. 看来您的群集尚未修补。

According to their announcement they will be patching clusters with UDFs over the next two weeks, depending on your region and maintenance window setting. 根据他们的公告,它们将在接下来的两周内使用UDF修补群集,具体取决于您所在的地区和维护时段设置。 The new cluster version will be 1.0.991. 新的群集版本将是1.0.991。

Just make sure that "AllowVersionUpgrade" is set to true . 只需确保将"AllowVersionUpgrade"设置为true This and other parameters you can get from the UI or by using cli command aws redshift describe-clusters 您可以从UI或使用cli命令获得此参数和其他参数, aws redshift describe-clusters

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM