{"record":{"id":"ca0bc3e04dcf5c35","repo":"prestodb/presto","slug":"unsupported-parquet-encoding","errorCode":null,"errorMessage":"Unsupported Parquet encoding: ","messagePattern":"Unsupported Parquet encoding: ","errorType":"exception","errorClass":"ParquetDecodingException","httpStatus":null,"severity":"error","filePath":"presto-parquet/src/main/java/com/facebook/presto/parquet/ParquetTypeUtils.java","lineNumber":176,"sourceCode":"        switch (encoding) {\n            case PLAIN:\n                return ParquetEncoding.PLAIN;\n            case RLE:\n                return ParquetEncoding.RLE;\n            case BIT_PACKED:\n                return ParquetEncoding.BIT_PACKED;\n            case PLAIN_DICTIONARY:\n                return ParquetEncoding.PLAIN_DICTIONARY;\n            case DELTA_BINARY_PACKED:\n                return ParquetEncoding.DELTA_BINARY_PACKED;\n            case DELTA_LENGTH_BYTE_ARRAY:\n                return ParquetEncoding.DELTA_LENGTH_BYTE_ARRAY;\n            case DELTA_BYTE_ARRAY:\n                return ParquetEncoding.DELTA_BYTE_ARRAY;\n            case RLE_DICTIONARY:\n                return ParquetEncoding.RLE_DICTIONARY;\n            default:\n                throw new ParquetDecodingException(\"Unsupported Parquet encoding: \" + encoding);\n        }\n    }\n\n    public static org.apache.parquet.schema.Type getParquetTypeByName(String columnName, GroupType messageType)\n    {\n        if (messageType.containsField(columnName)) {\n            return messageType.getType(columnName);\n        }\n        // parquet is case-sensitive, but hive is not. all hive columns get converted to lowercase\n        // check for direct match above but if no match found, try case-insensitive match\n        for (org.apache.parquet.schema.Type type : messageType.getFields()) {\n            if (type.getName().equalsIgnoreCase(columnName)) {\n                return type;\n            }\n        }\n\n        return null;\n    }","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-parquet/src/main/java/com/facebook/presto/parquet/ParquetTypeUtils.java#L158-L194","documentation":"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.","triggerScenarios":"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).","commonSituations":"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).","solutions":["Identify the offending encoding from the exception text and upgrade the Presto build / bundled parquet-mr library to a version that supports it.","Rewrite the Parquet file with an explicitly compatible encoding (e.g. SNAPPY-compressed PLAIN_DICTIONARY or RLE_DICTIONARY).","If you control the writer, disable the new encoding (e.g. set writer version/encoding options to a compatible set).","Check the column that failed; sometimes only one column type (e.g. FLOAT/DOUBLE with BYTE_STREAM_SPLIT) needs to be excluded or converted."],"exampleFix":"// before: reading BYTE_STREAM_SPLIT file with old writer\nspark.write().parquet(\"out\");\n// after: force compatible encodings on write\nspark.conf.set(\"spark.sql.parquet.writer.version\", \"v1\"); // PLAIN_DICTIONARY/RLE\nspark.write().parquet(\"out\");","handlingStrategy":"fallback","validationCode":"// preflight: inspect encodings present in the file footer\nfor (ColumnChunkMetaData cc : footer.getBlocks().stream().flatMap(b -> b.getColumns().stream()).collect(toList())) {\n    if (!SUPPORTED_ENCODINGS.contains(cc.getEncoding())) {\n        throw new IllegalStateException(\"Unsupported encoding \" + cc.getEncoding() + \" in column \" + cc.getPath());\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    parquetRecordReader.nextRecord();\n} catch (ParquetDecodingException e) {\n    if (e.getMessage().startsWith(\"Unsupported Parquet encoding\")) {\n        // route file to a rewrite job with compatible encodings\n    } else { throw e; }\n}","preventionTips":["Pin parquet writer settings to encodings your reader version supports.","Keep the parquet-mr dependency in the Presto build current with your writers.","Scan new file footers for unknown encodings before registering partitions."],"tags":["parquet","encoding","compatibility","decoding"],"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"}