risingwavelabs/risingwave · error · SinkError::Config

sink encode unsupported: {}

Error message

sink encode unsupported: {}

What it means

The SinkCatalog try_from conversion maps protobuf SinkEncode variants to the catalog's SinkEncode. Encodes such as Unspecified, Native, Csv, None, and Text are not supported for sinks and trigger this config error.

Source

Thrown at src/connector/src/sink/catalog/mod.rs:251

            | F::DebeziumMongo
            | F::Maxwell
            | F::Canal
            | F::None) => {
                return Err(SinkError::Config(anyhow!(
                    "sink format unsupported: {}",
                    f.as_str_name()
                )));
            }
        };
        let encode = match value.encode() {
            E::Json => SinkEncode::Json,
            E::Protobuf => SinkEncode::Protobuf,
            E::Template => SinkEncode::Template,
            E::Avro => SinkEncode::Avro,
            E::Parquet => SinkEncode::Parquet,
            E::Bytes => SinkEncode::Bytes,
            e @ (E::Unspecified | E::Native | E::Csv | E::None | E::Text) => {
                return Err(SinkError::Config(anyhow!(
                    "sink encode unsupported: {}",
                    e.as_str_name()
                )));
            }
        };
        let key_encode = match &value.key_encode() {
            E::Bytes => Some(SinkEncode::Bytes),
            E::Text => Some(SinkEncode::Text),
            E::Unspecified => None,
            encode @ (E::Avro
            | E::Csv
            | E::Json
            | E::Protobuf
            | E::Template
            | E::Native
            | E::Parquet
            | E::None) => {
                return Err(SinkError::Config(anyhow!(

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Set encode to a sink-supported value: json, protobuf, template, avro, parquet, or bytes.
  2. Always specify encode explicitly rather than relying on the default.
  3. Check per-connector documentation, since not every connector supports every listed encode.

Example fix

// before
WITH (connector='kafka', format='append_only', encode='text', ...)
// after
WITH (connector='kafka', format='append_only', encode='json', ...)
Defensive patterns

Strategy: validation

Validate before calling

const SINK_ENCODS = ['json', 'protobuf', 'template', 'avro', 'parquet', 'bytes'];
if (!SINK_ENCODS.includes(props.encode)) throw new Error(`Unsupported sink encode: ${props.encode}`);

Prevention

When it happens

Trigger: CREATE SINK with encode='csv'/'text'/'native' or with the encode field left unspecified (Unspecified) when building the sink catalog from the protobuf plan.

Common situations: Reusing source-oriented encode settings in a sink definition; forgetting the encode option; assuming CSV is supported for sinks when it is source-only.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/0eeb2b142f5d258c. Report an issue: GitHub.