{"record":{"id":"7ffc3161444b9194","repo":"prestodb/presto","slug":"parquet-unsupported-encoding-7ffc31","errorCode":"PARQUET_UNSUPPORTED_ENCODING","errorMessage":"Dictionary encoding is not supported: %s","messagePattern":"Dictionary encoding is not supported: (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/dictionary/Dictionaries.java","lineNumber":60,"sourceCode":"                case INT64:\n                case DOUBLE:\n                    return new LongDictionary(dictionaryPage);\n                case INT96:\n                    return new TimestampDictionary(dictionaryPage, timezone);\n                case BINARY:\n                    return new BinaryBatchDictionary(dictionaryPage);\n                case FIXED_LEN_BYTE_ARRAY:\n                    return new BinaryBatchDictionary(dictionaryPage, columnDescriptor.getPrimitiveType().getTypeLength());\n                case BOOLEAN:\n                default:\n                    break;\n            }\n        }\n        catch (Exception e) {\n            throw new ParquetDecodingException(\"could not decode the dictionary for \" + columnDescriptor, e);\n        }\n\n        throw new PrestoException(PARQUET_UNSUPPORTED_ENCODING, String.format(\"Dictionary encoding is not supported: %s\", columnDescriptor));\n    }\n}\n","sourceCodeStart":42,"sourceCodeEnd":63,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/dictionary/Dictionaries.java#L42-L63","documentation":"Dictionaries.createDictionary() switches on the column's primitive type to select a dictionary implementation; BOOLEAN (and any unrecognized type) falls through the switch without returning, reaching the final throw of PrestoException with code PARQUET_UNSUPPORTED_ENCODING and message \"Dictionary encoding is not supported: <columnDescriptor>\". Booleans cannot usefully be dictionary encoded here (a boolean dictionary would be at most two values), so this library refuses to build a dictionary page for such columns and asks callers to decode them with a non-dictionary path.","triggerScenarios":"createDictionary() is invoked for a column whose primitive type is BOOLEAN (or falls into the default case), i.e., the Parquet metadata advertises a dictionary page for a boolean (or otherwise unsupported) column, and the reader attempts to construct its dictionary.","commonSituations":"Writers that emit dictionary pages even for boolean columns; a BOOLEAN column mistakenly mapped to a dictionary-decodable type in a custom reader; custom/patched Parquet writers producing dictionary pages for unsupported primitive types; readers not checking the column's encoding before requesting a dictionary.","solutions":["Decode boolean columns with the RLE (non-dictionary) decoder — check column.getEncoding() and only call createDictionary for RLE_DICTIONARY/PLAIN_DICTIONARY supported types.","Rewrite the file with dictionary encoding disabled for boolean columns (parquet.enable.dictionary=false).","If you own the reader code, add a guard on the primitive type before attempting dictionary creation and fall back to plain/RLE decoding.","Upgrade Presto if a newer release added support for this column type's dictionary path."],"exampleFix":"// before\nDictionary dict = Dictionaries.createDictionary(descriptor, dictPage, tz); // PrestoException PARQUET_UNSUPPORTED_ENCODING\n\n// after\nif (descriptor.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.BOOLEAN) {\n    values = rleBooleanDecoder.read(descriptor, page); // no dictionary needed\n} else {\n    Dictionary dict = Dictionaries.createDictionary(descriptor, dictPage, tz);\n}","handlingStrategy":"validation","validationCode":"// Only request a dictionary for supported primitive types\nPrimitiveType pt = descriptor.getPrimitiveType();\nif (pt.getPrimitiveTypeName() == PrimitiveTypeName.BOOLEAN) {\n    throw new IllegalStateException(\"Boolean column: decode with RLE, no dictionary\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    Dictionary dict = Dictionaries.createDictionary(descriptor, dictPage, tz);\n} catch (PrestoException e) {\n    if (e.getErrorCode() == PARQUET_UNSUPPORTED_ENCODING.toErrorCode()) {\n        return decodeWithoutDictionary(descriptor, page); // RLE/plain path\n    }\n    throw e;\n}","preventionTips":["Check the column's primitive type before constructing dictionaries.","Disable dictionary encoding for boolean columns on the writer side.","Handle PARQUET_UNSUPPORTED_ENCODING by falling back to plain/RLE decoding.","Keep custom writers conformant: never emit dictionary pages for boolean columns."],"tags":["parquet","dictionary-encoding","unsupported-encoding","boolean"],"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"}