{"record":{"id":"077b84eb1925ca8a","repo":"prestodb/presto","slug":"unsupported-encoding","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/LongBatchStreamReader.java","lineNumber":93,"sourceCode":"        ColumnEncodingKind kind = stripe.getColumnEncodings().get(streamDescriptor.getStreamId())\n                .getColumnEncoding(streamDescriptor.getSequence())\n                .getColumnEncodingKind();\n        if (kind == DIRECT || kind == DIRECT_V2 || kind == DWRF_DIRECT) {\n            currentReader = directReader;\n            if (dictionaryReader != null && resetAllReaders) {\n                dictionaryReader.startStripe(timezone, stripe);\n                System.setProperty(\"RESET_LONG_BATCH_READER\", \"RESET_LONG_BATCH_READER\");\n            }\n        }\n        else if (kind == DICTIONARY) {\n            currentReader = dictionaryReader;\n            if (directReader != null && resetAllReaders) {\n                directReader.startStripe(timezone, stripe);\n                System.setProperty(\"RESET_LONG_BATCH_READER\", \"RESET_LONG_BATCH_READER\");\n            }\n        }\n        else {\n            throw new IllegalArgumentException(\"Unsupported encoding \" + kind);\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":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/reader/LongBatchStreamReader.java#L75-L111","documentation":"LongBatchStreamReader.startStripe only supports the encodings it initialized readers for (direct and dictionary). When a stripe's column encoding kind is anything else, it throws IllegalArgumentException(\"Unsupported encoding \" + kind). This indicates the ORC file uses an encoding this batch reader cannot decode.","triggerScenarios":"startStripe is called with a ColumnEncoding whose kind is not DIRECT/DIRECT_V2/DICTIONARY_V2 (e.g. map-dictionary or future encodings) for a BIGINT/INTEGER-type column read through the batch reader path.","commonSituations":"Reading ORC files written by newer writers or other engines (Hive 4, newer writer versions) that emit encodings unsupported by this Presto version; misconfigured ORC writer version; synthetic/test data forcing an unknown kind.","solutions":["Upgrade Presto to a version supporting the encoding kind in the file","Rewrite the ORC file with a compatible writer version (e.g. hive.orc.writer.version default) so the column uses DIRECT or DICTIONARY_V2","Set session hive.orc.use-column-names / writer settings or disable the batch reader path if a config flag controls it","Inspect the file's stripe encodings with orc-tools (java -jar orc-tools meta file.orc) to confirm which kind appears"],"exampleFix":"-- before\nSET SESSION hive.orc_writer_version = 'UNSTABLE';\n-- after\nSET SESSION hive.orc_writer_version = 'stable'; -- rewrite data with supported encodings","handlingStrategy":"try-catch","validationCode":"// Before querying, inspect file encodings with orc-tools:\n// java -jar orc-tools-*.jar meta data.orc | grep encoding","typeGuard":null,"tryCatchPattern":"try { reader.startStripe(timezone, stripe); } catch (IllegalArgumentException e) { throw new PrestoException(NOT_SUPPORTED, \"ORC encoding not supported: \" + e.getMessage() + \"; rewrite the file with a compatible writer\"); }","preventionTips":["Keep Presto upgraded to support newer ORC encodings","Write ORC files with the stable writer version (hive.orc.writer.version)","Inspect stripe encodings of external files before ingesting them","Avoid mixing files from writers with unsupported encoding kinds in one table"],"tags":["orc","encoding","unsupported-encoding","presto"],"backgroundTag":"unsupported-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"}