prestodb/presto · error · PrestoException
PARQUET_UNSUPPORTED_ENCODING
PARQUET_UNSUPPORTED_ENCODING
Error message
Dictionary encoding is not supported: %s
What it means
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.
Source
Thrown at presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/dictionary/Dictionaries.java:60
case INT64:
case DOUBLE:
return new LongDictionary(dictionaryPage);
case INT96:
return new TimestampDictionary(dictionaryPage, timezone);
case BINARY:
return new BinaryBatchDictionary(dictionaryPage);
case FIXED_LEN_BYTE_ARRAY:
return new BinaryBatchDictionary(dictionaryPage, columnDescriptor.getPrimitiveType().getTypeLength());
case BOOLEAN:
default:
break;
}
}
catch (Exception e) {
throw new ParquetDecodingException("could not decode the dictionary for " + columnDescriptor, e);
}
throw new PrestoException(PARQUET_UNSUPPORTED_ENCODING, String.format("Dictionary encoding is not supported: %s", columnDescriptor));
}
}
View on GitHub (pinned to 55bb57d202)
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.
Example fix
// before
Dictionary dict = Dictionaries.createDictionary(descriptor, dictPage, tz); // PrestoException PARQUET_UNSUPPORTED_ENCODING
// after
if (descriptor.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.BOOLEAN) {
values = rleBooleanDecoder.read(descriptor, page); // no dictionary needed
} else {
Dictionary dict = Dictionaries.createDictionary(descriptor, dictPage, tz);
} Defensive patterns
Strategy: validation
Validate before calling
// Only request a dictionary for supported primitive types
PrimitiveType pt = descriptor.getPrimitiveType();
if (pt.getPrimitiveTypeName() == PrimitiveTypeName.BOOLEAN) {
throw new IllegalStateException("Boolean column: decode with RLE, no dictionary");
} Try / catch
try {
Dictionary dict = Dictionaries.createDictionary(descriptor, dictPage, tz);
} catch (PrestoException e) {
if (e.getErrorCode() == PARQUET_UNSUPPORTED_ENCODING.toErrorCode()) {
return decodeWithoutDictionary(descriptor, page); // RLE/plain path
}
throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/7ffc3161444b9194.
Report an issue: GitHub.