prestodb/presto · error · ParquetDecodingException

Unsupported Parquet encoding:

Error message

Unsupported Parquet encoding: 

What it means

getParquetTypeUtils.getParquetEncoding maps Parquet's Encoding enum to the library's ParquetEncoding, and the default branch throws a ParquetDecodingException for any encoding it does not recognize. This means the file was written with an encoding this Presto-parquet build cannot decode — typically a newer encoding added after this code was compiled. The failure is unavoidable at read time without upgrading or rewriting the data.

Solutions

  1. Identify the offending encoding from the exception text and upgrade the Presto build / bundled parquet-mr library to a version that supports it.
  2. Rewrite the Parquet file with an explicitly compatible encoding (e.g. SNAPPY-compressed PLAIN_DICTIONARY or RLE_DICTIONARY).
  3. If you control the writer, disable the new encoding (e.g. set writer version/encoding options to a compatible set).
  4. Check the column that failed; sometimes only one column type (e.g. FLOAT/DOUBLE with BYTE_STREAM_SPLIT) needs to be excluded or converted.

Example fix

// before: reading BYTE_STREAM_SPLIT file with old writer
spark.write().parquet("out");
// after: force compatible encodings on write
spark.conf.set("spark.sql.parquet.writer.version", "v1"); // PLAIN_DICTIONARY/RLE
spark.write().parquet("out");
Defensive patterns

Strategy: fallback

Validate before calling

// preflight: inspect encodings present in the file footer
for (ColumnChunkMetaData cc : footer.getBlocks().stream().flatMap(b -> b.getColumns().stream()).collect(toList())) {
    if (!SUPPORTED_ENCODINGS.contains(cc.getEncoding())) {
        throw new IllegalStateException("Unsupported encoding " + cc.getEncoding() + " in column " + cc.getPath());
    }
}

Try / catch

try {
    parquetRecordReader.nextRecord();
} catch (ParquetDecodingException e) {
    if (e.getMessage().startsWith("Unsupported Parquet encoding")) {
        // route file to a rewrite job with compatible encodings
    } else { throw e; }
}

Prevention

When it happens

Trigger: Reading a Parquet column chunk whose page header declares an encoding enum value not handled by the switch (anything outside PLAIN, PLAIN_DICTIONARY, RLE, BIT_PACKED, DELTA_BINARY_PACKED, DELTA_LENGTH_BYTE_ARRAY, DELTA_BYTE_ARRAY, RLE_DICTIONARY).

Common situations: Files written by newer Parquet/Spark versions using encodings unknown to an old bundled parquet-mr; BYTE_STREAM_SPLIT encoded data; future/experimental encodings from other engines (e.g. newer writer defaults).

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/ca0bc3e04dcf5c35. Report an issue: GitHub.

Appendix: source

Thrown at presto-parquet/src/main/java/com/facebook/presto/parquet/ParquetTypeUtils.java:176

        switch (encoding) {
            case PLAIN:
                return ParquetEncoding.PLAIN;
            case RLE:
                return ParquetEncoding.RLE;
            case BIT_PACKED:
                return ParquetEncoding.BIT_PACKED;
            case PLAIN_DICTIONARY:
                return ParquetEncoding.PLAIN_DICTIONARY;
            case DELTA_BINARY_PACKED:
                return ParquetEncoding.DELTA_BINARY_PACKED;
            case DELTA_LENGTH_BYTE_ARRAY:
                return ParquetEncoding.DELTA_LENGTH_BYTE_ARRAY;
            case DELTA_BYTE_ARRAY:
                return ParquetEncoding.DELTA_BYTE_ARRAY;
            case RLE_DICTIONARY:
                return ParquetEncoding.RLE_DICTIONARY;
            default:
                throw new ParquetDecodingException("Unsupported Parquet encoding: " + encoding);
        }
    }

    public static org.apache.parquet.schema.Type getParquetTypeByName(String columnName, GroupType messageType)
    {
        if (messageType.containsField(columnName)) {
            return messageType.getType(columnName);
        }
        // parquet is case-sensitive, but hive is not. all hive columns get converted to lowercase
        // check for direct match above but if no match found, try case-insensitive match
        for (org.apache.parquet.schema.Type type : messageType.getFields()) {
            if (type.getName().equalsIgnoreCase(columnName)) {
                return type;
            }
        }

        return null;
    }

View on GitHub (pinned to 55bb57d202)