{"record":{"id":"f4936a2cbdc54928","repo":"prestodb/presto","slug":"unsupported-encoding-f4936a","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/MapBatchStreamReader.java","lineNumber":84,"sourceCode":"    {\n        return currentReader.readBlock();\n    }\n\n    @Override\n    public void startStripe(ZoneId timezone, Stripe stripe)\n            throws IOException\n    {\n        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        }\n        else if (kind == DWRF_MAP_FLAT) {\n            currentReader = flatReader;\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":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/reader/MapBatchStreamReader.java#L66-L102","documentation":"MapBatchStreamReader.startStripe selects the delegate reader (direct, flat, etc.) based on the stripe's encoding kind. If the kind matches none of the supported DWRF map encodings, it throws IllegalArgumentException('Unsupported encoding ' + kind). The file uses a map column encoding this reader does not implement.","triggerScenarios":"Reading a map column whose stripe encoding kind is not MAP_DIRECT, MAP_FLAT_DICTIONARY, or DWRF_MAP_FLAT — e.g. a newer DWRF map encoding from a newer writer, or corrupted footer metadata yielding an unexpected kind.","commonSituations":"Reading DWRF files written by newer Facebook tooling with an older Presto; files written by third-party engines emitting non-standard map encodings; schema/encoding metadata corruption after partial writes.","solutions":["Dump the ORC/DWRF footer (orc-tools) to identify the actual encoding kind of the map column.","Upgrade Presto to a version supporting the encoding.","Rewrite the table/file with standard MAP_DIRECT encoding using a compatible writer.","Check that you are not forcing a DWRF reader on a standard ORC file (or vice versa) — use the matching reader factory."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"ColumnEncodingKind kind = stripe.getColumnEncodings().get(columnId).getKind();\nif (!(kind == MAP_DIRECT || kind == MAP_FLAT_DICTIONARY || kind == DWRF_MAP_FLAT)) {\n    throw new IllegalArgumentException(\"Unsupported map encoding kind: \" + kind);\n}","typeGuard":"boolean isSupportedMapEncoding(ColumnEncodingKind kind) {\n    return kind == MAP_DIRECT || kind == MAP_FLAT_DICTIONARY || kind == DWRF_MAP_FLAT;\n}","tryCatchPattern":"try {\n    reader.startStripe(timezone, stripe);\n}\ncatch (IllegalArgumentException e) {\n    throw new PrestoException(ORC_BAD_DATA, \"Map column uses unsupported encoding: \" + e.getMessage(), e);\n}","preventionTips":["Inspect stripe encodings with orc-tools before onboarding new file producers.","Avoid mixing DWRF and ORC reader factories; use the one matching the file format.","Rewrite files with non-standard map encodings.","Upgrade Presto when writers add new encoding kinds."],"tags":["orc","dwrf","map","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"}