risingwavelabs/risingwave · error · SinkError
sink format/encode/key_encode unsupported: {:?} {:?} {:?}
Error message
sink format/encode/key_encode unsupported: {:?} {:?} {:?} What it means
The sink formatter dispatcher validates the full combination of (format, encode, key_encode) against a whitelist of supported tuples. Any combination not matched by an earlier arm — e.g. Parquet anywhere, Debezium with Avro/Protobuf/Template/Text/Bytes, or unsupported encodes used as key encode — falls into this catch-all arm and raises this configuration error listing the three values.
Source
Thrown at src/connector/src/sink/formatter/mod.rs:593
}
(F::Upsert, E::Template, None) => Impl::UpsertTemplate(build(p).await?),
(F::Debezium, E::Json, None) => Impl::DebeziumJson(build(p).await?),
(F::AppendOnly | F::Upsert, E::Text, _) => {
return Err(SinkError::Config(anyhow!(
"ENCODE TEXT is only valid as key encode."
)));
}
(F::AppendOnly, E::Avro, _)
| (F::Upsert, E::Protobuf, _)
| (F::Upsert, E::Bytes, _)
| (F::Debezium, E::Json, Some(_))
| (F::Debezium, E::Avro | E::Protobuf | E::Template | E::Text | E::Bytes, _)
| (_, E::Parquet, _)
| (_, _, Some(E::Parquet))
| (F::AppendOnly, E::Bytes, Some(_))
| (F::AppendOnly | F::Upsert, _, Some(E::Template) | Some(E::Json) | Some(E::Avro) | Some(E::Protobuf)) // reject other encode as key encode
=> {
return Err(SinkError::Config(anyhow!(
"sink format/encode/key_encode unsupported: {:?} {:?} {:?}",
format_desc.format,
format_desc.encode,
format_desc.key_encode
)));
}
},
)
}
}
/// Macro to dispatch formatting implementation for all supported sink formatter types.
/// Used when the message key can be either bytes or string.
///
/// Takes a formatter implementation ($impl), binds it to a name ($name),
/// and executes the provided code block ($body) with that binding.
#[macro_export]
macro_rules! dispatch_sink_formatter_impl {View on GitHub (pinned to 6469eb736d)
Solutions
- Review the three values printed in the message and change the unsupported one (usually encode or key_encode)
- Use FORMAT DEBEZIUM ENCODE JSON, or APPEND-ONLY/UPSERT with ENCODE JSON/Avro/Protobuf/Template/Bytes as supported in this version
- Check the formatter match table in src/connector/src/sink/formatter/mod.rs for the exact supported tuples
Example fix
// before CREATE SINK s FROM mv WITH (connector='kafka', FORMAT DEBEZIUM ENCODE AVRO); // after CREATE SINK s FROM mv WITH (connector='kafka', FORMAT DEBEZIUM ENCODE JSON);
Defensive patterns
Strategy: validation
Validate before calling
fn validate_combination(format: &str, encode: &str, key_encode: Option<&str>) -> Result<(), String> {
if encode.eq_ignore_ascii_case("parquet") || key_encode.map_or(false, |k| k.eq_ignore_ascii_case("parquet")) {
return Err("Parquet encode is not supported for sinks".into());
}
if format.eq_ignore_ascii_case("debezium") && !encode.eq_ignore_ascii_case("json") {
return Err("Debezium sinks only support ENCODE JSON".into());
}
Ok(())
} Prevention
- Only use combinations from the supported tuple table in the formatter dispatcher
- Never use Parquet encode in sink definitions
- Lint sink DDL against a whitelist before applying
When it happens
Trigger: CREATE SINK with any unsupported combination such as `ENCODE PARQUET`, `FORMAT DEZEBZIUM ENCODE AVRO`, `ENCODE BYTES` for append-only with a key encode, or JSON/Avro/Protobuf/Template used as key_encode for AppendOnly/Upsert sinks.
Common situations: Copying sink DDL from an older RisingWave version or another system where the combination was allowed; guessing at encodes like Parquet that are never supported for sinks.
Related errors
- sink encode unsupported: {}
- ENCODE TEXT is only valid as key encode.
- sink type unsupported: {}
- sink format unsupported: {}
- unsupported {} as sink key encode
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/18fad2565692565f.
Report an issue: GitHub.