When the AWS Lambda returns, it must format the response with a “data” key in the default JSON format. The output “data” contains a list of rows.
Scalar example of event[“data”]
Scalar UDCFs return a single row with a single field (by definition).
{
data: [
[0, col1],
]
}
Table Operator example of event[“data”]
There can be one or more rows in a response from the AWS Lambda. There is no requirement to return a single row per input row.
The type and number of fields returned in an AWS Lambda can be given by the OUTPUT clause. This clause specifies JSON array of objects whose key is the name of the return field and the value is the type of the return field.
One or more input columns can be given in the request depending on the specification in the OUTPUT clause. If no OUTPUT clause is specified, the input schema is used as the output schema.
{
data: [
[0, col1, col2, col3],
[1, col1, col2, col3],
[2, col1, col2, col3],
]
}