Managing UDFs in a database
Scalar UDF functions in Amazon Redshift are routines that are able to take parameters, perform calculations, and return the results. UDFs are handy when performing complex calculations that can be stored and reused in a SQL statement. Amazon Redshift supports UDFs that can be authored using either Python or SQL. In addition, Amazon Redshift also supports AWS Lambda UDFs, which opens up further possibilities to invoke other AWS services.
For example, let’s say the latest customer address information is stored in AWS DynamoDB—you can invoke an AWS Lambda UDF to retrieve this using a SQL statement in Amazon Redshift.
Getting ready
To complete this recipe, you will need the following:
- Everything mentioned in the Technical requirements section
- Access to create an Identity and Access Management (IAM) role that can invoke AWS Lambda and attach it to Amazon Redshift
- Access to create an AWS Lambda function