This guide describes how to sink data from RisingWave to Snowflake using the Snowflake sink connector in RisingWave.
WRITE
permission.Parameter | Description |
---|---|
s3.bucket_name | The S3 bucket where intermediate sink files will be stored. |
s3.path | Optional. The S3 path to be specified.
|
s3.credentials.access | S3 access credentials. |
s3.credentials.secret | S3 secret credentials. |
s3.region_name | The S3 region, e.g., us-east-2 . |
force_append_only | Optional. If true, forces the sink to be append-only, even if it cannot be. |
RisingWave type | Snowflake type |
---|---|
SMALLINT | SMALLINT |
INTEGER | INTEGER |
BIGINT | BIGINT |
REAL | FLOAT4 |
DECIMAL | DECIMAL |
DOUBLE | FLOAT8 |
BYTEA | BINARY |
VARCHAR | VARCHAR |
BOOLEAN | BOOLEAN |
DATE | DATE |
TIME | TIME |
TIMESTAMP | TIMESTAMP |
TIMESTAMPTZ | TIMESTAMP_TZ |
INTERVAL | Unsupported |
ARRAY | ARRAY |
JSONB | VARIANT (You need to convert JSONB to VARIANT using parse_json.) |
snowflake.s3_bucket
: URL in Snowflake stage.snowflake.aws_access_key_id
: AWS_KEY_ID in Snowflake stage.snowflake.aws_secret_access_key
: AWS_SECRET_KEY in Snowflake stage.AS CHANGELOG
in RisingWave.changelog_op
: the change type (1
= INSERT, 2
= DELETE, 3
= UPDATE-AFTER, 4
= UPDATE-BEFORE)_changelog_row_id
: a monotonically increasing identifier that captures the order of the change__op
and __row_id
) in the SELECT
list so they appear in the Snowflake sink.
RisingWave stops here. It does not merge the incremental data for you.MERGE INTO
that keeps the newest _changelog_row_id
per primary key.MERGE INTO
statement to fold the change-log records into the target table. The workflow relies on three Snowflake tables:
target_table
: Stores the consolidated, up-to-date data.cdc_table
: Holds the incremental change-log records produced by the sink.offset_table
: Records the last processed _row_id
for each CDC table. If you maintain multiple CDC tables, they can all share the same offset table.cdc_table
: Holds the incremental change-log records written by the sink.target_table
: A dynamic table that materializes the consolidated, current state.