risingwavelabs/risingwave · error

`{option}` is not supported for '{}' compaction type

Error message

`{option}` is not supported for '{}' compaction type

What it means

Each iceberg compaction type only supports a subset of tuning options (e.g. small_files_threshold_mb is only valid for certain types). Setting an option unsupported by the configured compaction.type is rejected at validation time.

Source

Thrown at src/connector/src/sink/iceberg/mod.rs:141

        return Ok(());
    };

    let unsupported_option = match compaction_type {
        // Auto uses both selection thresholds.
        CompactionType::Auto => None,
        // Keep accepting strategy-specific thresholds that Full ignores.
        CompactionType::Full => None,
        CompactionType::SmallFiles => config
            .delete_files_count_threshold
            .is_some()
            .then_some(COMPACTION_DELETE_FILES_COUNT_THRESHOLD),
        CompactionType::FilesWithDelete => config
            .small_files_threshold_mb
            .is_some()
            .then_some(COMPACTION_SMALL_FILES_THRESHOLD_MB),
    };
    if let Some(option) = unsupported_option {
        bail!(
            "`{option}` is not supported for '{}' compaction type",
            compaction_type.as_str()
        );
    }

    Ok(())
}

impl IcebergSink {
    pub async fn create_and_validate_table(&self) -> Result<Table> {
        create_and_validate_table_impl(&self.config, &self.param).await
    }

    /// Returns `true` if this call created the table, `false` if it already existed.
    pub async fn create_table_if_not_exists(&self) -> Result<bool> {
        create_table_if_not_exists_impl(&self.config, &self.param).await
    }

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Remove the unsupported option (e.g. small_files_threshold_mb) or change compaction.type to one that supports it
  2. Check which options are valid for the chosen compaction type in the docs
  3. After an ALTER of compaction.type, reset incompatible options

Example fix

// before
WITH (connector='iceberg', compaction.type='files-with-delete', small_files_threshold_mb=128)
// after
WITH (connector='iceberg', compaction.type='full', small_files_threshold_mb=128)
Defensive patterns

Strategy: validation

Validate before calling

let supported: HashSet<&str> = match compaction_type {
    "full" => ["small_files_threshold_mb"].into(),
    "files-with-delete" => [].into(),
    _ => return Ok(()),
};
for opt in options.keys() {
    if !supported.contains(opt.as_str()) { return Err(format!("{opt} unsupported for {compaction_type}")); }
}

Prevention

When it happens

Trigger: Creating or altering an iceberg sink where an option like small_files_threshold_mb is set but the compaction.type in effect does not accept it.

Common situations: Mixing example configs across compaction types; changing compaction.type via ALTER while legacy options remain set.

Related errors


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