risingwavelabs/risingwave · error
`compaction.write_parquet_compression` must be one of
Error message
`compaction.write_parquet_compression` must be one of {:?}, got: {} What it means
When altering an Iceberg sink config, `compaction.write_parquet_compression` must name a Parquet codec the writer supports. The value is lowercased and checked against a fixed list (uncompressed, snappy, gzip, lzo, brotli, lz4, zstd, etc.); anything else fails validation.
Solutions
- Set the value to one of the valid codec names, e.g. `zstd` or `snappy` (lowercase).
- Remove the property to use the default compression codec.
- If you need codec-level options (like zstd levels), remove the level suffix and check whether a separate tuning option exists.
Example fix
-- before
ALTER SINK s SET ('compaction.write_parquet_compression'='zstd-3');
-- after
ALTER SINK s SET ('compaction.write_parquet_compression'='zstd'); Defensive patterns
Strategy: validation
Validate before calling
const VALID_CODECS: &[&str] = &["uncompressed","snappy","gzip","lzo","brotli","lz4","zstd"];
fn valid_codec(cfg: &std::collections::BTreeMap<String, String>) -> Result<(), String> {
if let Some(c) = cfg.get("compaction.write_parquet_compression") {
if !VALID_CODECS.contains(&c.to_lowercase().as_str()) {
return Err(format!("write_parquet_compression must be one of {VALID_CODECS:?}, got {c}"));
}
}
Ok(())
} Prevention
- Use bare codec names without levels or variants (no 'zstd-3', no 'lz4_raw').
- Copy codec names from the error message's valid list.
- Keep a shared constants list in your deployment tooling matching the engine.
When it happens
Trigger: `ALTER SINK ... SET` with `compaction.write_parquet_compression` set to a misspelled or unsupported codec such as `Snappy!`, `zstd1`, `GZIP_LEVEL6`, or `lz4_raw`.
Common situations: Users copying codec names from other engines that accept extra variants (e.g. `lz4_raw`, `zstd-1`) or appended compression levels; case-sensitive assumptions (lowercasing is applied, so casing alone is fine).
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- `compaction.write_parquet_max_row_group_bytes` must be…
- `compaction.write_parquet_max_row_group_rows` must be…
- `compaction-interval-sec` must be greater than 0 when…
- `compaction.max_snapshots_num` must be greater than 0, got
- `compaction.target_file_size_mb` must be greater than 0
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/681f7f73a39a8fc4.
Report an issue: GitHub.
Appendix: source
Thrown at src/connector/src/sink/iceberg/mod.rs:366
if let Some(max_row_group_bytes) = iceberg_config.write_parquet_max_row_group_bytes
&& max_row_group_bytes == 0
{
bail!("`compaction.write_parquet_max_row_group_bytes` must be greater than 0");
}
// Validate parquet compression codec
if let Some(ref compression) = iceberg_config.write_parquet_compression {
let valid_codecs = [
"uncompressed",
"snappy",
"gzip",
"lzo",
"brotli",
"lz4",
"zstd",
];
if !valid_codecs.contains(&compression.to_lowercase().as_str()) {
bail!(
"`compaction.write_parquet_compression` must be one of {:?}, got: {}",
valid_codecs,
compression
);
}
}
Ok(())
}
async fn new_log_sinker(&self, writer_param: SinkWriterParam) -> Result<Self::LogSinker> {
let writer = IcebergSinkWriter::new(
self.config.clone(),
self.param.clone(),
writer_param.clone(),
self.upsert_primary_key_column_names.clone(),
);
View on GitHub (pinned to 6469eb736d)