{"record":{"id":"aefff60301316818","repo":"prestodb/presto","slug":"parquet-unsupported-encoding","errorCode":"PARQUET_UNSUPPORTED_ENCODING","errorMessage":"Column: %s, Encoding: %s","messagePattern":"Column: (.+?), Encoding: (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/decoders/Decoders.java","lineNumber":297,"sourceCode":"        if (encoding == DELTA_BYTE_ARRAY && type == PrimitiveTypeName.FIXED_LEN_BYTE_ARRAY) {\n            if (isDecimalType(columnDescriptor)) {\n                ByteBufferInputStream inputStream = ByteBufferInputStream.wrap(ByteBuffer.wrap(buffer, offset, length));\n                ValuesReader parquetReader = getParquetReader(encoding, columnDescriptor, valueCount, inputStream);\n\n                if (isShortDecimalType(columnDescriptor)) {\n                    return new FixedLenByteArrayShortDecimalDeltaValueDecoder(parquetReader, columnDescriptor);\n                }\n\n                return new FixedLenByteArrayLongDecimalDeltaValueDecoder(parquetReader);\n            }\n            else if (isUuidType(columnDescriptor)) {\n                ByteBufferInputStream inputStream = ByteBufferInputStream.wrap(ByteBuffer.wrap(buffer, offset, length));\n                ValuesReader parquetReader = getParquetReader(encoding, columnDescriptor, valueCount, inputStream);\n                return new FixedLenByteArrayUuidDeltaValuesDecoder(parquetReader);\n            }\n        }\n\n        throw new PrestoException(PARQUET_UNSUPPORTED_ENCODING, format(\"Column: %s, Encoding: %s\", columnDescriptor, encoding));\n    }\n\n    private static ValuesReader getParquetReader(ParquetEncoding encoding, ColumnDescriptor descriptor, int valueCount, ByteBufferInputStream inputStream)\n            throws IOException\n    {\n        ValuesReader valuesReader = encoding.getValuesReader(descriptor, VALUES);\n        valuesReader.initFromPage(valueCount, inputStream);\n        return valuesReader;\n    }\n\n    private static FlatDecoders readFlatPageV1(DataPageV1 page, RichColumnDescriptor columnDescriptor, Dictionary dictionary)\n            throws IOException\n    {\n        byte[] bytes = page.getSlice().getBytes();\n        ByteBuffer byteBuffer = ByteBuffer.wrap(bytes, 0, bytes.length);\n        FlatDefinitionLevelDecoder definitionLevelDecoder = createFlatDefinitionLevelDecoder(\n                page.getDefinitionLevelEncoding(),\n                columnDescriptor.isRequired(),","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/decoders/Decoders.java#L279-L315","documentation":"PrestoException (PARQUET_UNSUPPORTED_ENCODING) thrown at the end of Decoders.createValuesDecoder() when no branch matched the page's (type, encoding) combination at all — the encoding is not supported by the batch reader for this column. Unlike the type-specific errors, this signals an entirely unhandled encoding (or a supported encoding on a type outside its allowed branches).","triggerScenarios":"createValuesDecoder() (via valuesDecoder, createValuesDecoderV1/V2 paths) receives a ParquetEncoding not covered by PLAIN, RLE-boolean, dictionary, DELTA_BINARY_PACKED, DELTA_BYTE_ARRAY/DELTA_LENGTH_BYTE_ARRAY, or the UUID delta branch — e.g., exotic encodings or new encodings from newer writers.","commonSituations":"Reading files produced with encodings introduced after your Presto version; writers using BYTE_STREAM_SPLIT or other niche encodings; encrypted/extended encodings.","solutions":["Dump the file's encoding per column with parquet-tools to identify the unhandled encoding.","Upgrade Presto to a version supporting that encoding.","Rewrite the file with standard encodings (PLAIN/RLE/dictionary).","Fall back to the legacy (non-batch) Parquet reader if available."],"exampleFix":"// before\n// unknown encoding -> PARQUET_UNSUPPORTED_ENCODING\n// after\n// force supported encodings in writer config\n writer.withEncoding(PLAIN) // or PLAIN_DICTIONARY/RLE_DICTIONARY\n","handlingStrategy":"validation","validationCode":"// enumerate encodings in the file footer and check support before reading\nSet<Encoding> used = pages.stream().map(p -> p.getEncoding()).collect(toSet());\nused.removeAll(SUPPORTED_ENCODINGS); // PLAIN, RLE, PLAIN_DICTIONARY, RLE_DICTIONARY, DELTA_*\nif (!used.isEmpty()) throw new IllegalArgumentException(\"Unsupported encodings: \" + used);","typeGuard":null,"tryCatchPattern":"try {\n    decoder = Decoders.readFlatPage(page, columnDescriptor, dictionary);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getName().equals(\"PARQUET_UNSUPPORTED_ENCODING\")) {\n        // rewrite the file with standard encodings or upgrade Presto\n    }\n    throw e;\n}","preventionTips":["Inspect file encodings with parquet-tools before ingestion","Upgrade Presto when writers introduce new encodings","Rewrite files with nonstandard encodings","Pin writer/reader parquet library versions"],"tags":["parquet","unsupported-encoding","presto"],"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-12T02:17:10.037Z"}