{"record":{"id":"71e67510c8d9fb45","repo":"prestodb/presto","slug":"unsupported-encoding-71e675","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/LongSelectiveStreamReader.java","lineNumber":93,"sourceCode":"                }\n                currentReader = directReader;\n                if (dictionaryReader != null && context.isResetAllReaders()) {\n                    dictionaryReader = null;\n                    System.setProperty(\"RESET_LONG_READER\", \"RESET_LONG_READER\");\n                }\n                break;\n            case DICTIONARY:\n                if (dictionaryReader == null) {\n                    dictionaryReader = new LongDictionarySelectiveStreamReader(context);\n                }\n                currentReader = dictionaryReader;\n                if (directReader != null && context.isResetAllReaders()) {\n                    directReader = null;\n                    System.setProperty(\"RESET_LONG_READER\", \"RESET_LONG_READER\");\n                }\n                break;\n            default:\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(context.getStreamDescriptor())\n                .toString();","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/reader/LongSelectiveStreamReader.java#L75-L111","documentation":"LongSelectiveStreamReader.startStripe validates that the stripe's stream encoding kind is one this reader supports (DIRECT, DIRECT_V2, DICTIONARY, etc.). When the stripe reports an unknown/unsupported encoding kind, the reader cannot decode it and throws IllegalArgumentException. This typically means the ORC/DWRF file uses an encoding the current Presto version does not implement.","triggerScenarios":"Reading a stripe whose ColumnEncoding kind falls into the default branch — e.g. a DWRF-specific or newer encoding written by a newer writer version being read by an older Presto.","commonSituations":"Cross-version file interchange: files written by newer Facebook DWRF writers or other engines read by an older Presto; corrupted stripe metadata in the ORC footer causing a bogus encoding kind; custom forks adding encodings not present upstream.","solutions":["Inspect the file's writer version and column encodings (orc-tools `meta` / ORC footer dump) to confirm which encoding kind is present.","Upgrade Presto to a version that supports the encoding used by the file.","Re-write the file with a compatible writer (e.g. `SET hive.exec.orc.encoding.style` or rewrite via Hive/Spark with default encodings).","If the kind is bogus due to corruption, re-copy/regenerate the file and validate checksums."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"ColumnEncoding encoding = stripe.getColumnEncodings().get(columnId);\nif (!SUPPORTED_LONG_KINDS.contains(encoding.getKind())) {\n    throw new IllegalArgumentException(\"Stripe encoding \" + encoding.getKind() + \" unsupported for long column\");\n}","typeGuard":"boolean isSupportedLongEncoding(ColumnEncodingKind kind) {\n    return kind == DIRECT || kind == DIRECT_V2 || kind == DICTIONARY || kind == DICTIONARY_V2;\n}","tryCatchPattern":"try {\n    reader.startStripe(timezone, stripe);\n}\ncatch (IllegalArgumentException e) {\n    throw new PrestoException(ORC_BAD_DATA, \"Unsupported stripe encoding for long column: \" + e.getMessage(), e);\n}","preventionTips":["Dump footers with orc-tools when ingesting files from new writers/clusters.","Keep reader and writer versions aligned; upgrade readers before ingesting files from newer writers.","Rewrite external files with standard encodings before loading.","Monitor for encoding kinds appearing in your data lake and add support proactively."],"tags":["orc","dwrf","unsupported-encoding"],"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"}