{"record":{"id":"4b65d962903f588c","repo":"risingwavelabs/risingwave","slug":"intermediate-table-name-is-required-for-non-append","errorCode":null,"errorMessage":"intermediate.table.name is required for non-append-only sink","messagePattern":"intermediate\\.table\\.name is required for non-append-only sink","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/snowflake_redshift/redshift.rs","lineNumber":330,"sourceCode":"        let schema = param.schema();\n        if config.with_s3 {\n            let s3_writer = SnowflakeRedshiftSinkS3Writer::new(\n                config.s3_inner.ok_or_else(|| {\n                    SinkError::Config(anyhow!(\"S3 configuration is required for S3 sink\"))\n                })?,\n                schema,\n                is_append_only,\n                config.table,\n            )?;\n            Ok(Self::S3(s3_writer))\n        } else {\n            let (writer_schema, writer_table) = if is_append_only {\n                (config.schema.clone(), config.table.clone())\n            } else {\n                (\n                    config.intermediate_schema.clone().or(config.schema.clone()),\n                    config.cdc_table.clone().ok_or_else(|| {\n                        SinkError::Config(anyhow!(\n                            \"intermediate.table.name is required for non-append-only sink\"\n                        ))\n                    })?,\n                )\n            };\n            param.properties.remove(\"schema\");\n            param.properties.remove(\"schema.name\");\n            if let Some(writer_schema) = writer_schema {\n                param.properties.insert(\"schema\".to_owned(), writer_schema);\n            }\n            let jdbc_writer = SnowflakeRedshiftSinkJdbcWriter::new(\n                is_append_only,\n                writer_param,\n                param,\n                writer_table,\n            )\n            .await?;\n            Ok(Self::Jdbc(jdbc_writer))","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/snowflake_redshift/redshift.rs#L312-L348","documentation":"For a non-append-only Snowflake/Redshift S3 sink, writes go to an intermediate CDC table rather than the final table; `new` therefore requires `config.cdc_table` (`intermediate.table.name`) to be present. When it is None for a non-append-only sink, this SinkError::Config is returned.","triggerScenarios":"Creating a non-append-only sink (data has updates/deletes) targeting Snowflake/Redshift with S3 staging but without the `intermediate.table.name` property; falling through the else branch of the writer schema/table selection.","commonSituations":"Upsert sinks missing the intermediate table config; users copying an append-only sink definition and adding a primary key (making it non-append-only) without adding the intermediate table.","solutions":["Set `intermediate.table.name` (and `intermediate.schema.name` if needed) in the sink properties","Create the intermediate table in the target database with the sink schema","If updates are never expected, define the sink as append-only to use the final table directly"],"exampleFix":"// before\nWITH ( connector = 'redshift', table = 'final_table', primary_key = 'id' )\n-- after\nWITH ( connector = 'redshift', table = 'final_table', primary_key = 'id', 'intermediate.table.name' = 'rw_cdc_staging' )","handlingStrategy":"validation","validationCode":"// before creating a non-append-only snowflake/redshift sink\nif !is_append_only && !props.contains_key(\"intermediate.table.name\") {\n    return Err(\"intermediate.table.name is required for non-append-only sink\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set intermediate.table.name together with primary_key for upsert sinks","Provision the intermediate staging table in the target database","Review sink type (append-only vs upsert) before finalizing properties"],"tags":["rust","risingwave","sink","snowflake","redshift","config"],"backgroundTag":"missing-required-config-field","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}