UDCF data format - Teradata VantageCloud Lake

Lake - Using Queries, UDFs, and External Stored Procedures

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-08-12
dita:mapPath
vgj1683671089901.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
vgj1683671089901

The data format is used to exchange data between the AWS Lambda function and the database. The AWS Lambda must conform to this format to send and receive data properly with the database.

Default json format

A default json format is implemented to encode data from the database into an object using the data key:
  • data: database data sent by the UDCF to the endpoint (in the request) or the return value(s) of the endpoint (in the response from the AWS Lambda).
    • data is a list (json array) of rows.
    • A row is a list whose first element contains an index. The rest of the elements contain the scalar UDCF arguments or Table Operator UDCF columns in the ON clause.
    • The index is an internally generated counter that can be used to correlate the response row given an input row. It has distinct values per row in the event[“data”] during a single invocation. The index values may not necessarily be unique across AWS Lambda invocations.
    • The index is not a column nor argument specified in the UDCF SQL. An index is required in the response of the AWS Lambda. The index field is not allowed in the return_spec nor OUTPUT clause. When returning data back to the database from the AWS Lambda, the row must conform to the “return_spec” field for the scalar UDCF or OUTPUT clause for the table operator UDCF.

General Usage Considerations

  • Currently, the only supported key is “data”. Other keys returned in the UDCF will be ignored.
  • Supported database types sent to the AWS Lambda are serialized as follows:
    • Strings (CHAR, VARCHAR) are serialized as JSON strings.
    • NULL is serialized as JSON null.
  • Data received from the Lambda must be compatible with the supported database types specified in the return_spec or OUTPUT clause of the UDCF.
    If the fields passed back from the “data” key in the response are:
    • Strings: They are serialized back to CHAR or VARCHAR in the database.
    • Non-strings: They return an error.

UDCF-Specific Usage Considerations

Usage Consideration Scalar UDCF Table Operator UDCF
All datatypes must fit within the quotas imposed by the endpoint. For instance, AWS Lambda supports 6 MB in requests and responses for synchronous requests. Only one row is supported for requests and responses to and from the AWS Lambda function. Rows are batched for each participating AMP in the table operator query (executing in parallel) and sent to the AWS Lambda function.
CHAR and VARCHAR database type support Can be specified in the return_spec or argument Can be specified in the OUTPUT clause or columns in the ON clause
Argument support Supports a single argument N/A