Posted On: Nov 26, 2019
Amazon Athena now supports user-defined functions (UDFs), a feature that enables customers to write custom scalar functions and invoke them in SQL queries. While Athena provides built-in functions, UDFs enable customers to perform custom processing such as compressing and decompressing data, redacting sensitive data, or applying customized decryption.
Customers can write their UDFs in Java using the Athena Query Federation SDK. When a UDF is used in a SQL query submitted to Athena, it is invoked and executed on AWS Lambda. UDFs can be used in both SELECT and FILTER clauses of a SQL query. Users can invoke multiple UDFs in the same query.
Athena UDF functionality is available in Preview mode in the us-east-1 (N. Virginia) region. Begin your Preview now by following these steps.
To learn more, please see our documentation.
Common UDF example implementations are available here.
To learn how to write your own functions using the Athena Query Federation SDK, please visit this link.