简体   繁体   中英

AWS Redshift UDF Error

I am trying to implement Redshift UDFs. It should be straightforward according to the docs: 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.

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;

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. The new cluster version will be 1.0.991.

Just make sure that "AllowVersionUpgrade" is set to true . This and other parameters you can get from the UI or by using cli command aws redshift describe-clusters

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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