prestodb/presto · error · ParquetDecodingException
could not decode the dictionary for
Error message
could not decode the dictionary for
What it means
Thrown in AbstractColumnReader.init when the dictionary page for a column chunk exists but its encoding fails to initialize a Dictionary object. The original IOException is wrapped in a ParquetDecodingException naming the column descriptor. This means the file declares a dictionary for the column but the dictionary page bytes/encoding cannot be decoded by this reader.
Source
Thrown at presto-parquet/src/main/java/com/facebook/presto/parquet/reader/AbstractColumnReader.java:115
@Override
public boolean isInitialized()
{
return pageReader != null && field != null;
}
@Override
public void init(PageReader pageReader, Field field, RowRanges rowRanges, Optional<DateTimeZone> timezone)
{
this.pageReader = requireNonNull(pageReader, "pageReader is null");
this.field = requireNonNull(field, "field is null");
DictionaryPage dictionaryPage = pageReader.readDictionaryPage();
if (dictionaryPage != null) {
try {
dictionary = dictionaryPage.getEncoding().initDictionary(columnDescriptor, dictionaryPage);
}
catch (IOException e) {
throw new ParquetDecodingException("could not decode the dictionary for " + columnDescriptor, e);
}
}
else {
dictionary = null;
}
checkArgument(pageReader.getValueCountInColumnChunk() > 0, "page is empty");
valueCountInColumnChunk = pageReader.getValueCountInColumnChunk();
indexIterator = (rowRanges == null) ? null : rowRanges.iterator();
}
@Override
public void prepareNextRead(int batchSize)
{
readOffset = readOffset + nextBatchSize;
nextBatchSize = batchSize;
}
@OverrideView on GitHub (pinned to 55bb57d202)
Solutions
- Verify the file integrity (re-copy / checksum) and re-read; a truncated or corrupted dictionary page is the most common cause.
- Rewrite the file with dictionary encoding disabled (e.g. parquet.writer.dictionary... or parquet-tools rewrite) so no dictionary page is present.
- Check the writer version that produced the file; if a known writer bug, re-export the data with a fixed/newer writer.
- Upgrade Presto in case initDictionary lacks support for the encoding used by the writer.
- As a fallback, disable predicate pushdown/scan that column via a full rewrite to PLAIN encoding.
Example fix
// before (reading corrupt file directly) SELECT col FROM corrupted_table; -- ParquetDecodingException: could not decode the dictionary for ... // after (rewrite without dictionary encoding, then read) // $ parquet-tools rewrite --disable-dictionary bad.parquet fixed.parquet SELECT col FROM fixed_table;
Defensive patterns
Strategy: try-catch
Validate before calling
// Validate the file before scanning: dump dictionary pages // $ parquet-tools dump file.parquet | head # fails/errs on corrupt dictionary boolean readable = new ParquetMetadataReader().readFooter(file) != null;
Try / catch
try {
// scan / initColumnReader
}
catch (ParquetDecodingException e) {
if (e.getMessage().startsWith("could not decode the dictionary for")) {
logger.warn("Corrupt dictionary, falling back to rewrite/plain read", e);
// fall back to reading a rewritten (non-dictionary) copy
} else {
throw e;
}
} Prevention
- Verify checksums after copying Parquet files between storage systems.
- Use atomic/complete uploads so files are never read while truncated.
- Periodically validate files with parquet-tools in CI.
- Rewrite files from buggy writers with a current Parquet version.
When it happens
Trigger: dictionaryPage != null and dictionaryPage.getEncoding().initDictionary(columnDescriptor, dictionaryPage) throws IOException — corrupt or truncated dictionary page, dictionary encoded with PLAIN_DICTIONARY/RLE_DICTIONARY bytes this reader cannot parse, or a dictionary page whose contents don't match the column schema.
Common situations: Files corrupted in transit or truncated by a failed copy; files written by a writer producing dictionary pages with encodings or bit widths Presto's reader mishandles; HDFS/S3 reads returning partial data; writer bugs (e.g. old versions of certain writers writing malformed dictionaries).
Related errors
- not a valid mode
- could not decode the dictionary for
- Dictionary is missing for Page
- Unsupported Parquet encoding:
- Failed to decode.
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/32416d441e293ad1.
Report an issue: GitHub.