{"record":{"id":"c52b57004876a27e","repo":"prestodb/presto","slug":"unsupported-encoding-c52b57","errorCode":null,"errorMessage":"Unsupported encoding ","messagePattern":"Unsupported encoding ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceBatchStreamReader.java","lineNumber":106,"sourceCode":"        ColumnEncodingKind columnEncodingKind = stripe.getColumnEncodings().get(streamDescriptor.getStreamId())\n                .getColumnEncoding(streamDescriptor.getSequence())\n                .getColumnEncodingKind();\n        if (columnEncodingKind == DIRECT || columnEncodingKind == DIRECT_V2 || columnEncodingKind == DWRF_DIRECT) {\n            currentReader = directReader;\n            if (dictionaryReader != null && resetAllReaders) {\n                dictionaryReader.startStripe(timezone, stripe);\n                System.setProperty(\"RESET_SLICE_BATCH_READER\", \"RESET_SLICE_BATCH_READER\");\n            }\n        }\n        else if (columnEncodingKind == DICTIONARY || columnEncodingKind == DICTIONARY_V2) {\n            currentReader = dictionaryReader;\n            if (directReader != null && resetAllReaders) {\n                directReader.startStripe(timezone, stripe);\n                System.setProperty(\"RESET_SLICE_BATCH_READER\", \"RESET_SLICE_BATCH_READER\");\n            }\n        }\n        else {\n            throw new IllegalArgumentException(\"Unsupported encoding \" + columnEncodingKind);\n        }\n\n        currentReader.startStripe(timezone, stripe);\n    }\n\n    @Override\n    public void startRowGroup(InputStreamSources dataStreamSources)\n            throws IOException\n    {\n        currentReader.startRowGroup(dataStreamSources);\n    }\n\n    @Override\n    public String toString()\n    {\n        return toStringHelper(this)\n                .addValue(streamDescriptor)\n                .toString();","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceBatchStreamReader.java#L88-L124","documentation":"SliceBatchStreamReader.startStripe dispatches to a slice (string/binary) reader based on the column encoding kind. If the encoding is not one of the supported slice encodings, it throws IllegalArgumentException. This indicates the file's column encoding is incompatible with the slice batch reader.","triggerScenarios":"startStripe encountering a columnEncodingKind outside the supported set for slice columns (e.g., dictionary/direct variants not implemented, or a non-slice encoding due to corrupt metadata).","commonSituations":"Files written by newer/other engines with encodings this reader doesn't know; corrupt stripe metadata; wrong reader chosen for the column type.","solutions":["Upgrade presto-orc to a version supporting the encoding","Rewrite the file with standard DIRECT or DICTIONARY string encodings","Verify the reader matches the column's actual ORC type and encoding","Inspect the file footer/stripe metadata to identify the unexpected encoding"],"exampleFix":"// before\nthrow new IllegalArgumentException(\"Unsupported encoding \" + columnEncodingKind);\n// after\nthrow new OrcCorruptionException(descriptor.getOrcDataSourceId(), \"Unsupported slice encoding %s in %s\", columnEncodingKind, descriptor.getStreamName());","handlingStrategy":"validation","validationCode":"ColumnEncodingKind kind = stripe.getColumnEncoding(columnId).getColumnEncodingKind(); if (!supportedSliceEncodings.contains(kind)) { throw new IllegalArgumentException(\"Unsupported slice encoding: \" + kind); }","typeGuard":"boolean isSupportedSliceEncoding(ColumnEncodingKind k) { return k == DIRECT || k == DIRECT_V2 || k == DICTIONARY || k == DWRF_DIRECT; }","tryCatchPattern":"try { reader.startStripe(timezone, stripe); } catch (IllegalArgumentException e) { throw new UnsupportedFileFormatException(\"Slice encoding unsupported: \" + e.getMessage(), e); }","preventionTips":["Match reader version to the writer engine that produced the file","Prefer standard DIRECT/DICTIONARY string encodings when writing","Verify the reader type (slice) matches the column's ORC kind (VARCHAR/BINARY)","Validate stripe encodings before large scan jobs"],"tags":["orc","encoding","slice","unsupported-type"],"backgroundTag":"unsupported-orc-encoding","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"}