{"record":{"id":"a6110c8060210115","repo":"apache/iceberg","slug":"unsupported-compression-codec-a6110c","errorCode":null,"errorMessage":"Unsupported compression codec: ","messagePattern":"Unsupported compression codec: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"orc/src/main/java/org/apache/iceberg/orc/ORC.java","lineNumber":381,"sourceCode":"            strategyAsString != null\n                ? toCompressionStrategy(strategyAsString)\n                : dataContext.compressionStrategy();\n\n        return new Context(\n            stripeSize,\n            blockSize,\n            vectorizedRowBatchSize,\n            compressionKind,\n            compressionStrategy,\n            dataContext.bloomFilterColumns(),\n            dataContext.bloomFilterFpp());\n      }\n\n      private static CompressionKind toCompressionKind(String codecAsString) {\n        try {\n          return CompressionKind.valueOf(codecAsString.toUpperCase(Locale.ROOT));\n        } catch (IllegalArgumentException e) {\n          throw new IllegalArgumentException(\"Unsupported compression codec: \" + codecAsString);\n        }\n      }\n\n      private static CompressionStrategy toCompressionStrategy(String strategyAsString) {\n        try {\n          return CompressionStrategy.valueOf(strategyAsString.toUpperCase(Locale.ROOT));\n        } catch (IllegalArgumentException e) {\n          throw new IllegalArgumentException(\n              \"Unsupported compression strategy: \" + strategyAsString);\n        }\n      }\n    }\n  }\n\n  public static DataWriteBuilder writeData(OutputFile file) {\n    return new DataWriteBuilder(file);\n  }\n","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/orc/src/main/java/org/apache/iceberg/orc/ORC.java#L363-L399","documentation":"ORC.DrwBuilder/compressionKind converts the user-supplied write.property value for compression into ORC's CompressionKind enum via valueOf on the uppercased string. If the string is not a valid ORC CompressionKind name (e.g. zstd on a build without zstd, or a typo like 'snappy ' or 'gzip2'), IllegalArgumentException is thrown with this message.","triggerScenarios":"Setting write.orc.compression-codec (or the builder's configValue) to a string that is not exactly one of ORC's CompressionKind enum names after uppercasing: NOT ZSTD, ZLIB, SNAPPY, LZO, LZ4, NONE, GZIP.","commonSituations":"Typo in table property (e.g. 'ZSTD_1', 'snappy-compression'); using a codec like ZSTD on an older ORC library that lacks it; copying Parquet codec names (e.g. 'BROTLI', 'GZIP_LEVEL') into ORC properties.","solutions":["Use a valid ORC codec name: ZSTD, LZ4, LZO, SNAPPY, ZLIB, GZIP, or NONE","Check the installed ORC library version supports the codec (e.g. ZSTD requires ORC with zstd support)","Remove the write.orc.compression-codec property to use the ORC default","Trim whitespace/typos in the property value"],"exampleFix":"// before\ntable.updateProperties().set(\"write.orc.compression-codec\", \"BROTLI\").commit();\n// after\ntable.updateProperties().set(\"write.orc.compression-codec\", \"ZSTD\").commit();","handlingStrategy":"validation","validationCode":"Set<String> valid = Set.of(\"ZSTD\",\"ZLIB\",\"SNAPPY\",\"LZO\",\"LZ4\",\"GZIP\",\"NONE\");\nString codec = props.getProperty(\"write.orc.compression-codec\", \"\").toUpperCase(Locale.ROOT).trim();\nif (!valid.contains(codec)) throw new IllegalArgumentException(\"Invalid ORC codec: \" + codec);","typeGuard":null,"tryCatchPattern":"try {\n  writer = ORC.write(output).set(\"write.orc.compression-codec\", codec).build();\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"Unsupported compression codec\")) {\n    log.warn(\"Falling back to default ORC compression: {}\", e.getMessage());\n    writer = ORC.write(output).build();\n  } else throw e;\n}","preventionTips":["Only use ORC enum names: NOT ZSTD variants aside, valid values are ZSTD, ZLIB, SNAPPY, LZO, LZ4, GZIP, NONE","Do not copy Parquet codec names into ORC properties","Trim whitespace from property values","Verify ORC library version supports the desired codec"],"tags":["orc","configuration","compression","invalid-enum"],"backgroundTag":"invalid-config-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}