Sample synchronous Lambda function¶
This topic includes code for a sample Lambda Function that you can use as-is to create your first external function, or that you can use as a starting point for a custom Lambda Function.
This function is synchronous.
(A separate asynchronous example is also available.)
This example is written in Python.
This sample synchronous Lambda Function extracts each row, processes it, and returns a value for that row. Each output value is simply an array that contains a copy of each of the values in the input row. The returned array is treated as a SQL VARIANT by Snowflake.
Note
This sample code assumes that you are using Lambda proxy integration, as Snowflake recommends in the instructions to create the API Gateway endpoint.