{"record":{"id":"4cae25e4b1020192","repo":"prestodb/presto","slug":"unsupported-encoding-4cae25","errorCode":null,"errorMessage":"Unsupported encoding: ","messagePattern":"Unsupported encoding: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/decoders/delta/BinaryDeltaValuesDecoder.java","lineNumber":53,"sourceCode":" */\npublic class BinaryDeltaValuesDecoder\n        implements BinaryValuesDecoder\n{\n    private static final int INSTANCE_SIZE = ClassLayout.parseClass(BinaryDeltaValuesDecoder.class).instanceSize();\n\n    private final ValuesReader innerReader;\n\n    public BinaryDeltaValuesDecoder(ParquetEncoding encoding, int valueCount, ByteBufferInputStream bufferInputStream)\n            throws IOException\n    {\n        if (encoding == DELTA_BYTE_ARRAY) {\n            innerReader = new DeltaByteArrayReader();\n        }\n        else if (encoding == DELTA_LENGTH_BYTE_ARRAY) {\n            innerReader = new DeltaLengthByteArrayValuesReader();\n        }\n        else {\n            throw new IllegalArgumentException(\"Unsupported encoding: \" + encoding);\n        }\n        innerReader.initFromPage(valueCount, bufferInputStream);\n    }\n\n    @Override\n    public ValueBuffer readNext(int length)\n            throws IOException\n    {\n        Binary[] values = new Binary[length];\n        int bufferSize = 0;\n        for (int i = 0; i < length; i++) {\n            Binary value = innerReader.readBytes();\n            values[i] = value;\n            bufferSize += value.length();\n        }\n        return new DeltaValueBuffer(values, bufferSize);\n    }\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/decoders/delta/BinaryDeltaValuesDecoder.java#L35-L71","documentation":"BinaryDeltaValuesDecoder's constructor selects an inner values reader based on the Parquet encodings enum: DELTA_BINARY_PACKED, DELTA_BYTE_ARRAY, or DELTA_LENGTH_BYTE_ARRAY. Any other encoding is rejected with an IllegalArgumentException because binary delta decoding only supports those three encodings.","triggerScenarios":"Constructing BinaryDeltaValuesDecoder for a column chunk whose encoding is none of DELTA_BINARY_PACKED, DELTA_BYTE_ARRAY, or DELTA_LENGTH_BYTE_ARRAY (e.g. PLAIN or a future encoding routed here by mistake).","commonSituations":"A routing/selection bug upstream sends a PLAIN-encoded binary column to the delta decoder; files written with encodings the reader doesn't map; reader version mismatches where the encoder-selection logic disagrees with the writer.","solutions":["Check the column chunk's actual encoding in the file metadata (parquet-tools) and confirm which decoder should be used","If the data is plain-encoded, ensure the code path selects the plain values decoder instead of the delta decoder","Upgrade presto-parquet so new encodings are mapped to the right decoder","If the file is valid but unsupported, rewrite it with a supported encoding"],"exampleFix":"// before (upstream routing): encoderSelection -> BinaryDeltaValuesDecoder for PLAIN encoding\n// after: dispatch to the matching decoder\n// if (encoding == Encoding.PLAIN) { return new BinaryPlainValuesDecoder(...); }\n// return new BinaryDeltaValuesDecoder(encoding, valueCount, bufferInputStream);","handlingStrategy":"type-guard","validationCode":"// Confirm the column's encoding before expecting delta decoding:\n// parquet-tools meta file.parquet | grep <binary column>  # must show DELTA_BINARY_PACKED / DELTA_BYTE_ARRAY / DELTA_LENGTH_BYTE_ARRAY","typeGuard":"boolean isDeltaBinaryEncoding(org.apache.parquet.schema.PrimitiveType t, Encoding e) {\n    return e == Encoding.DELTA_BINARY_PACKED\n        || e == Encoding.DELTA_BYTE_ARRAY\n        || e == Encoding.DELTA_LENGTH_BYTE_ARRAY;\n}","tryCatchPattern":"try {\n    ValuesDecoder d = new BinaryDeltaValuesDecoder(encoding, valueCount, in);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unsupported encoding\")) {\n        // route to the correct decoder for this encoding\n    }\n    throw e;\n}","preventionTips":["Verify column encodings in file metadata before choosing a decoder","Keep decoder-selection logic in sync with supported encodings","Rewrite files that use unmapped encodings","Upgrade the reader when writers introduce new encodings"],"tags":["parquet","encoding","delta-decoder"],"backgroundTag":"parquet-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"}