{"record":{"id":"b571ba07b9d2cb2f","repo":"prestodb/presto","slug":"unsupported-encoding-b571ba","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/MapSelectiveStreamReader.java","lineNumber":94,"sourceCode":"\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            if (flatReader == null) {\n                throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), \"Flat map reader does not support nesting \" + streamDescriptor);\n            }\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":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/reader/MapSelectiveStreamReader.java#L76-L112","documentation":"startStripe in MapSelectiveStreamReader only recognizes DIRECT, DIRECT_V2, DWRF_DIRECT, and DWRF_MAP_FLAT column encodings. Any other encoding kind for a map column throws IllegalArgumentException. It indicates an encoding the map selective reader cannot handle.","triggerScenarios":"Reading a stripe whose map column encoding kind is something outside the supported set (e.g., a future/unknown DWRF encoding kind) hitting startStripe.","commonSituations":"Files produced by newer writers with encodings unknown to this reader version; corrupt footer metadata encoding values.","solutions":["Upgrade Presto/presto-orc to a version that knows the encoding","Rewrite the file with standard DIRECT/DWRF_DIRECT map encodings","Validate the file's column encodings before reading","Check for writer/reader version mismatch in your deployment"],"exampleFix":"// before\nthrow new IllegalArgumentException(\"Unsupported encoding \" + kind);\n// after\nthrow new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), \"Unsupported map encoding %s in %s\", kind, streamDescriptor);","handlingStrategy":"validation","validationCode":"Set<ColumnEncodingKind> supported = EnumSet.of(DIRECT, DIRECT_V2, DWRF_DIRECT, DWRF_MAP_FLAT); if (!supported.contains(kind)) { throw new IllegalArgumentException(\"Map encoding not supported: \" + kind); }","typeGuard":"boolean isSupportedMapEncoding(ColumnEncodingKind k) { return k == DIRECT || k == DIRECT_V2 || k == DWRF_DIRECT || k == DWRF_MAP_FLAT; }","tryCatchPattern":"try { reader.startStripe(timezone, stripe); } catch (IllegalArgumentException e) { throw new UnsupportedFileFormatException(\"Map encoding unsupported by this Presto version: \" + e.getMessage(), e); }","preventionTips":["Upgrade Presto before reading files from newer writers","Validate footer encodings during ingestion","Standardize writer settings to produce DIRECT/DWRF_DIRECT maps","Add version-compatibility checks between writer clusters and reader clusters"],"tags":["orc","dwrf","encoding","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"}