Syntax
Parameters
| Parameter | Description |
|---|---|
| jdbc.url | JDBC URL to connect to Redshift |
| user | Redshift username |
| password | Redshift password |
| schema | Redshift schema name |
| table.name | Name of the target table |
| intermediate.table.name | Name of the intermediate table used for upsert mode. No need to fill this out in append-only mode |
| auto_schema_change | Enable automatic schema change for upsert sink; adds new columns to target table if needed |
| create_table_if_not_exists | Create target table if it does not exist |
| write.target.interval.seconds | Interval in seconds for triggering writes to the target table (default: 3600) |
| write.intermediate.interval.seconds | Interval in seconds for triggering writes to intermediate storage (default: 1800) |
| batch_insert_rows | Number of rows per batch insert (default: 4096) |
with_s3 = true:
| Parameter | Description |
|---|---|
| with_s3 | Enable writing via S3 (default: true) |
| s3.region_name | AWS region for S3 |
| s3.bucket_name | S3 bucket name |
| s3.path | S3 folder path for sink files |
| enable_config_load | Load S3 credentials from environment |
| s3.credentials.access | AWS access key ID |
| s3.credentials.secret | AWS secret access key |
| s3.endpoint_url | Custom S3 endpoint URL (for self-hosted setups) |
| s3.assume_role | IAM role ARN to assume for S3 access |
Auto schema change
Redshift sinks support auto schema change to automatically adapt their output schema according to changes in the upstream table. This feature is supported only whensink_decoupling is disabled.
Once auto schema change is enabled, if you add new columns to the source table, the sink will automatically update to match the new schema. This reduces manual intervention and makes your data pipelines more robust to schema evolution.
To enable it, set the following option when creating the sink:
Configure RisingWave to write to S3
You need to configure how RisingWave authenticates with AWS S3. There are two primary methods:- Access Key / Secret Key (AK/SK) authentication
CREATE SINK statement.
- Assume role authentication
- Obtaining the RisingWave Cloud IAM role ARN (Workload Identity (IAM Role ARN)) from the Cloud metadata page in the Console (Connection → Cloud Meta tab).
- Creating an IAM policy with the necessary S3 read/write permissions for your bucket and prefix.
- Configuring the IAM Role’s trust policy to use the RisingWave Cloud IAM role ARN as the trusted principal.
Append-only and upsert modes
Amazon Redshift sink connector supports bothappend-only and upsert modes for flexible data handling.
In upsert mode, performance is optimized through the use of an intermediate table:
-
An intermediate table is created to stage data before merging it into the target table. If
create_table_if_not_existsis set to true, the table is automatically namedrw_<target_table_name>_<uuid>. -
Data is written to intermediate storage (S3) at intervals defined by
write.intermediate.interval.seconds(default: 1800 seconds). -
Data is periodically merged from the intermediate table into the target table according to the
write.target.interval.secondssetting (default: 3600 seconds). - By default, an S3 bucket is required to achieve optimal ingestion performance into the intermediate table.
-
Alternatively, you can use
INSERTSQL statements to load data directly into the intermediate table, though this approach is not recommended due to performance drawbacks.
- Redshift sink with S3 writer (Append-only mode)
- Redshift sink with S3 writer (Upsert mode)
Set up Redshift
When configuring RisingWave to write to Redshift, the JDBC user must have appropriate permissions depending on whether thecreate_table_if_not_exists option is enabled.
- If
create_table_if_not_existsis not enabled, the user must have permissions on the target table:
- If
create_table_if_not_existsis enabled, the user needs the table permissions above plus schema-level permissions to create new tables:
Set up Redshift S3 integration
When using S3 as an intermediate storage for Redshift sinks, you need to configure assume role permissions so that RisingWave can write to the user’s S3 bucket.- Permissions for the S3 account configured in RisingWave
- Permissions for Redshift to access the S3 account
Set up S3 IAM and role
To guarantee that the IAM role has sufficient permissions to connect to Redshift and access AWS resources:- Attach policy to the IAM Role
AmazonRedshiftAllCommandsFullAccess to the role.
- Configure trusted entities
- Attach the IAM role to Redshift instance
- Navigate to the Amazon Redshift service in the AWS Management Console.
- In the left navigation pane, select Clusters and choose the cluster you want to configure.
- From the Actions menu, select Manage IAM Roles, and attach the configured IAM role.