{"record":{"id":"69448cd3b790241e","repo":"prestodb/presto","slug":"compression-not-implemented-yet","errorCode":null,"errorMessage":" compression not implemented yet","messagePattern":" compression not implemented yet","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/metadata/OrcMetadataReader.java","lineNumber":621,"sourceCode":"                throw new IllegalStateException(columnEncodingKind + \" stream encoding not implemented yet\");\n        }\n    }\n\n    private static CompressionKind toCompression(OrcProto.CompressionKind compression)\n    {\n        switch (compression) {\n            case NONE:\n                return NONE;\n            case ZLIB:\n                return ZLIB;\n            case SNAPPY:\n                return SNAPPY;\n            case LZ4:\n                return LZ4;\n            case ZSTD:\n                return ZSTD;\n            default:\n                throw new IllegalStateException(compression + \" compression not implemented yet\");\n        }\n    }\n}\n","sourceCodeStart":603,"sourceCodeEnd":625,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/metadata/OrcMetadataReader.java#L603-L625","documentation":"OrcMetadataReader.toCompression() converts a protobuf ORC CompressionKind read from a file's postscript into the internal CompressionKind enum. When the enum case has no mapping (e.g. the file uses a compression codec this reader version does not know), it throws IllegalStateException instead of returning a value. It signals the file's compression is not supported by this Presto ORC reader.","triggerScenarios":"Reading an ORC file whose postscript declares a compression kind that falls into the default branch of toCompression(), triggered from readPostScript() during file open/metadata read.","commonSituations":"Opening ORC files written by newer writers using codecs not in the enum mapping; corrupted or hand-crafted postscript; reader/writer version skew where the writer supports a codec the reader doesn't.","solutions":["Upgrade presto-orc (and Presto) to a version whose OrcMetadataReader maps the compression kind used by the file","Rewrite/recompress the ORC file with a supported codec (ZLIB, SNAPPY, LZ4, ZSTD)","Inspect the file's postscript compression kind to confirm which codec is unsupported"],"exampleFix":"// before\nOrcDataSource dataSource = new FileOrcDataSource(file, config);\n// after\n// verify the file's compression is supported before opening:\nCompressionKind kind = readPostscriptCompression(file); // e.g. ZSTD\nif (!EnumSet.of(ZLIB, SNAPPY, LZ4, ZSTD).contains(kind)) {\n    throw new IllegalArgumentException(\"Recompress file; unsupported codec: \" + kind);\n}","handlingStrategy":"validation","validationCode":"// Read the postscript compression kind before opening the ORC file and compare against supported set\nEnumSet<CompressionKind> supported = EnumSet.of(ZLIB, SNAPPY, LZ4, ZSTD);\nif (!supported.contains(fileCompressionKind)) {\n    throw new IllegalArgumentException(\"Recompress ORC file; unsupported codec: \" + fileCompressionKind);\n}","typeGuard":null,"tryCatchPattern":"try {\n    orcReader = new OrcReader(dataSource, ...);\n} catch (IllegalStateException e) {\n    if (e.getMessage() != null && e.getMessage().endsWith(\"compression not implemented yet\")) {\n        throw new IOException(\"ORC file uses an unsupported compression codec; upgrade or recompress\", e);\n    }\n    throw e;\n}","preventionTips":["Pin reader and writer to versions supporting the same codec set","Standardize ORC output on ZLIB or SNAPPY","Validate file metadata in ingestion pipelines before querying"],"tags":["orc","compression","unsupported-codec","file-format"],"backgroundTag":"unsupported-compression-codec","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}