{"record":{"id":"b39becdc5cadedd3","repo":"apache/flink","slug":"unsupported-encoding","errorCode":null,"errorMessage":"Unsupported encoding: {}","messagePattern":"Unsupported encoding: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/vector/reader/AbstractColumnReader.java","lineNumber":204,"sourceCode":"                    readBatchFromDictionaryIds(0, rowId, vector, vector.getDictionaryIds());\n                }\n                vector.setDictionary(null);\n                readBatch(rowId, num, vector);\n            }\n\n            valuesRead += num;\n            rowId += num;\n            readNumber -= num;\n        }\n    }\n\n    private void readPageV1(DataPageV1 page) throws IOException {\n        this.pageValueCount = page.getValueCount();\n        ValuesReader rlReader = page.getRlEncoding().getValuesReader(descriptor, REPETITION_LEVEL);\n\n        // Initialize the decoders.\n        if (page.getDlEncoding() != Encoding.RLE && descriptor.getMaxDefinitionLevel() != 0) {\n            throw new UnsupportedOperationException(\n                    \"Unsupported encoding: \" + page.getDlEncoding());\n        }\n        int bitWidth = BytesUtils.getWidthFromMaxInt(descriptor.getMaxDefinitionLevel());\n        this.runLenDecoder = new RunLengthDecoder(bitWidth);\n        try {\n            BytesInput bytes = page.getBytes();\n            ByteBufferInputStream in = bytes.toInputStream();\n            rlReader.initFromPage(pageValueCount, in);\n            this.runLenDecoder.initFromStream(pageValueCount, in);\n            prepareNewPage(page.getValueEncoding(), in);\n        } catch (IOException e) {\n            throw new IOException(\"could not read page \" + page + \" in col \" + descriptor, e);\n        }\n    }\n\n    private void readPageV2(DataPageV2 page) throws IOException {\n        this.pageValueCount = page.getValueCount();\n","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/vector/reader/AbstractColumnReader.java#L186-L222","documentation":"UnsupportedOperationException from readPageV1 in AbstractColumnReader: for a DataPageV1, definition levels must be RLE-encoded whenever the column has maxDefinitionLevel > 0 (nested/nullable columns). The guard rejects any other definition-level encoding (notably legacy BIT_PACKED from very old Parquet 1.x writers) before attempting to decode.","triggerScenarios":"Reading a DataPageV1 whose page.getDlEncoding() != Encoding.RLE on a column with descriptor.getMaxDefinitionLevel() != 0.","commonSituations":"Ancient files written by early Parquet writers (pre-RLE BIT_PACKED def levels); files passed through lossy converters; some third-party encoders emitting non-standard V1 pages.","solutions":["Rewrite the old files with a modern writer (Spark/parquet-mr rewrite job) so def levels are RLE","If the files must stay untouched, read them with a legacy-capable tool and convert to a supported encoding","Upgrade Flink only if release notes add legacy encoding support - the standard fix is rewriting the data"],"exampleFix":"// e.g. rewrite with Spark:\n// spark.read.parquet(\"old\").write.mode(\"Overwrite\").parquet(\"new\");","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (UnsupportedOperationException e) { if (e.getMessage() != null && e.getMessage().startsWith(\"Unsupported encoding:\")) { /* rewrite legacy BIT_PACKED files with a modern writer */ } else throw e; }","preventionTips":["Re-encode legacy Parquet 1.x data with current tools before ingesting","Standardize on RLE definition levels for any custom writer"],"tags":["parquet","encoding","legacy-format","flink"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}