{"record":{"id":"df072a2615e2b005","repo":"risingwavelabs/risingwave","slug":"option-is-not-supported-for-compaction-ty","errorCode":null,"errorMessage":"`{option}` is not supported for '{}' compaction type","messagePattern":"`(.+?)` is not supported for '(.+?)' compaction type","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/iceberg/mod.rs","lineNumber":141,"sourceCode":"        return Ok(());\n    };\n\n    let unsupported_option = match compaction_type {\n        // Auto uses both selection thresholds.\n        CompactionType::Auto => None,\n        // Keep accepting strategy-specific thresholds that Full ignores.\n        CompactionType::Full => None,\n        CompactionType::SmallFiles => config\n            .delete_files_count_threshold\n            .is_some()\n            .then_some(COMPACTION_DELETE_FILES_COUNT_THRESHOLD),\n        CompactionType::FilesWithDelete => config\n            .small_files_threshold_mb\n            .is_some()\n            .then_some(COMPACTION_SMALL_FILES_THRESHOLD_MB),\n    };\n    if let Some(option) = unsupported_option {\n        bail!(\n            \"`{option}` is not supported for '{}' compaction type\",\n            compaction_type.as_str()\n        );\n    }\n\n    Ok(())\n}\n\nimpl IcebergSink {\n    pub async fn create_and_validate_table(&self) -> Result<Table> {\n        create_and_validate_table_impl(&self.config, &self.param).await\n    }\n\n    /// Returns `true` if this call created the table, `false` if it already existed.\n    pub async fn create_table_if_not_exists(&self) -> Result<bool> {\n        create_table_if_not_exists_impl(&self.config, &self.param).await\n    }\n","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/iceberg/mod.rs#L123-L159","documentation":"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.","triggerScenarios":"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.","commonSituations":"Mixing example configs across compaction types; changing compaction.type via ALTER while legacy options remain set.","solutions":["Remove the unsupported option (e.g. small_files_threshold_mb) or change compaction.type to one that supports it","Check which options are valid for the chosen compaction type in the docs","After an ALTER of compaction.type, reset incompatible options"],"exampleFix":"// before\nWITH (connector='iceberg', compaction.type='files-with-delete', small_files_threshold_mb=128)\n// after\nWITH (connector='iceberg', compaction.type='full', small_files_threshold_mb=128)","handlingStrategy":"validation","validationCode":"let supported: HashSet<&str> = match compaction_type {\n    \"full\" => [\"small_files_threshold_mb\"].into(),\n    \"files-with-delete\" => [].into(),\n    _ => return Ok(()),\n};\nfor opt in options.keys() {\n    if !supported.contains(opt.as_str()) { return Err(format!(\"{opt} unsupported for {compaction_type}\")); }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check docs for option support per compaction type","Reset incompatible options when ALTERing compaction.type","Lint sink WITH clauses in CI/SQL review"],"tags":["iceberg","sink","config","compaction"],"backgroundTag":"unsupported-config-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}