Snowflake forwarder input/output data
This page provides an example of input and output data in the Snowflake forwarder function.
Input data
The Snowflake forwarder receives records from an upstream node. Each record's payload fields are available in the configured SQL statement using @{payload.<fieldName>} syntax.
The following example shows how to write subscription usage records to a Snowflake table. Each record contains these fields:
Field | Example value |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
The following SQL statement is configured in the function to insert each record into the SUBSCRIPTION_USAGE table:
INSERT INTO USAGE_DATA.PUBLIC.SUBSCRIPTION_USAGE
(SUBSCRIPTION_ID, CUSTOMER_NAME, SERVICE_TYPE, USAGE_DATE, QUANTITY, UNIT_PRICE)
VALUES
(@{payload.subscription_id}, @{payload.customer_name}, @{payload.service_type},
@{payload.usage_date}, @{payload.quantity}, @{payload.unit_price})Output data
The Snowflake forwarder does not produce output records. After the function runs, records are written directly to the configured Snowflake table.
To view the number of records written, check the Logs section of the function. The logs show the total count of records inserted, updated, or deleted for each stream run.