{"record":{"id":"ef9f2a52d44586f1","repo":"risingwavelabs/risingwave","slug":"invalid-compaction-type-must-be-one-of","errorCode":null,"errorMessage":"invalid compaction_type: {}, must be one of: {}, {}, {}, {}","messagePattern":"invalid compaction_type: (.+?), must be one of: (.+?), (.+?), (.+?), (.+?)","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/iceberg/config.rs","lineNumber":261,"sourceCode":"        match self {\n            CompactionType::Auto => ICEBERG_COMPACTION_TYPE_AUTO,\n            CompactionType::Full => ICEBERG_COMPACTION_TYPE_FULL,\n            CompactionType::SmallFiles => ICEBERG_COMPACTION_TYPE_SMALL_FILES,\n            CompactionType::FilesWithDelete => ICEBERG_COMPACTION_TYPE_FILES_WITH_DELETE,\n        }\n    }\n}\n\nimpl std::str::FromStr for CompactionType {\n    type Err = SinkError;\n\n    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {\n        match s {\n            ICEBERG_COMPACTION_TYPE_AUTO => Ok(CompactionType::Auto),\n            ICEBERG_COMPACTION_TYPE_FULL => Ok(CompactionType::Full),\n            ICEBERG_COMPACTION_TYPE_SMALL_FILES => Ok(CompactionType::SmallFiles),\n            ICEBERG_COMPACTION_TYPE_FILES_WITH_DELETE => Ok(CompactionType::FilesWithDelete),\n            _ => Err(SinkError::Config(anyhow!(format!(\n                \"invalid compaction_type: {}, must be one of: {}, {}, {}, {}\",\n                s,\n                ICEBERG_COMPACTION_TYPE_AUTO,\n                ICEBERG_COMPACTION_TYPE_FULL,\n                ICEBERG_COMPACTION_TYPE_SMALL_FILES,\n                ICEBERG_COMPACTION_TYPE_FILES_WITH_DELETE\n            )))),\n        }\n    }\n}\n\nimpl TryFrom<&str> for CompactionType {\n    type Error = <Self as std::str::FromStr>::Err;\n\n    fn try_from(value: &str) -> std::result::Result<Self, Self::Error> {\n        value.parse()\n    }\n}","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/iceberg/config.rs#L243-L279","documentation":"This is the FromStr parser for the `CompactionType` iceberg sink option. Only 'auto', 'full', 'small-files', and 'files-with-delete' (the ICEBERG_COMPACTION_TYPE_* constants) are accepted; any other compaction_type string fails with this config error at sink creation/validation time.","triggerScenarios":"A CREATE SINK ... WITH (connector='iceberg', compaction_type='...') uses a string outside the four accepted literals — e.g. 'none', ' Auto', 'full compaction', or a camel-case variant.","commonSituations":"Typos and casing mistakes when hand-writing WITH options; copying compaction option names from other iceberg tools; older option values that no longer exist after connector updates.","solutions":["Set compaction_type to exactly one of: auto, full, small-files, files-with-delete","Remove the compaction_type option to use the default (auto)","Match the literal constants in src/connector/src/sink/iceberg/config.rs if unsure of spelling","Use kebab-case lowercase strings, no extra whitespace"],"exampleFix":"// before\nWITH (connector = 'iceberg', compaction_type = 'Full')\n// after\nWITH (connector = 'iceberg', compaction_type = 'full')","handlingStrategy":"validation","validationCode":"const VALID_COMPACTION_TYPES: [&str; 4] =\n    [\"auto\", \"full\", \"small-files\", \"files-with-delete\"];\nfn validate_compaction_type(t: &str) -> Result<(), String> {\n    if VALID_COMPACTION_TYPES.contains(&t) {\n        Ok(())\n    } else {\n        Err(format!(\n            \"invalid compaction_type: {}, must be one of: auto, full, small-files, files-with-delete\",\n            t\n        ))\n    }\n}","typeGuard":"fn is_valid_compaction_type(s: &str) -> bool {\n    matches!(s, \"auto\" | \"full\" | \"small-files\" | \"files-with-delete\")\n}","tryCatchPattern":"match s.parse::<CompactionType>() {\n    Ok(ct) => ct,\n    Err(e) => return Err(e.context(\"compaction_type must be a lowercase kebab-case literal from docs\")),\n}","preventionTips":["Use exactly one of: auto, full, small-files, files-with-delete (lowercase kebab-case)","Omit compaction_type to get the 'auto' default","Lint/validate sink WITH options in CI before deployment","Cross-check spelling against ICEBERG_COMPACTION_TYPE_* constants when in doubt"],"tags":["iceberg","config","enum-parsing","rust"],"backgroundTag":"invalid-enum-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}