prestodb/presto · error · ParquetDecodingException

Dictionary is missing for Page

Error message

Dictionary is missing for Page

What it means

initDataReader throws this when a page uses dictionary encoding (RLE_DICTIONARY / PLAIN_DICTIONARY) but the column reader's dictionary field is null — i.e. no dictionary page was supplied or decoded for this column chunk. A dictionary-encoded page cannot be decoded without its dictionary, so reading fails immediately.

Source

Thrown at presto-parquet/src/main/java/com/facebook/presto/parquet/reader/AbstractColumnReader.java:338

        long firstRowIndex = page.getFirstRowIndex().orElse(-1L);
        return initDataReader(page.getDataEncoding(), ByteBufferInputStream.wrap(ImmutableList.of(page.getSlice().toByteBuffer())), page.getValueCount(), firstRowIndex);
    }

    private LevelReader buildLevelRLEReader(int maxLevel, Slice slice)
    {
        if (maxLevel == 0) {
            return new LevelNullReader();
        }

        return new LevelRLEReader(new RunLengthBitPackingHybridDecoder(BytesUtils.getWidthFromMaxInt(maxLevel), slice.getInput()));
    }

    private ValuesReader initDataReader(ParquetEncoding dataEncoding, ByteBufferInputStream inputStream, int valueCount, long firstRowIndex)
    {
        ValuesReader valuesReader;
        if (dataEncoding.usesDictionary()) {
            if (dictionary == null) {
                throw new ParquetDecodingException("Dictionary is missing for Page");
            }
            valuesReader = dataEncoding.getDictionaryBasedValuesReader(columnDescriptor, VALUES, dictionary);
        }
        else {
            valuesReader = dataEncoding.getValuesReader(columnDescriptor, VALUES);
        }

        try {
            valuesReader.initFromPage(valueCount, inputStream);
            if (firstRowIndex != -1) {
                currentRow = firstRowIndex - 1;
            }
            else {
                currentRow = -1;
            }
            return valuesReader;
        }
        catch (IOException e) {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Validate/re-copy the file; ensure the dictionary page for the column chunk is present and readable (parquet-tools dump).
  2. Rewrite the file with dictionary encoding disabled so all data pages use plain encoding.
  3. Re-export the data with a reliable writer if the file's dictionary metadata is inconsistent.
  4. Upgrade Presto in case dictionary-page lookup/handling for that encoding is fixed in a newer version.
  5. Check for earlier ParquetDecodingException logs for the same column — a failed initDictionary will leave dictionary null and surface as this error on the first data page.

Example fix

// before
SELECT col FROM broken_table;  -- ParquetDecodingException: Dictionary is missing for Page

// after (rewrite without dictionary encoding)
// $ parquet-tools rewrite bad.parquet fixed.parquet
SELECT col FROM fixed_table;
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify dictionary pages exist for dictionary-encoded chunks before reading
// $ parquet-tools dump file.parquet  # dictionary pages appear per column chunk

Try / catch

try {
    // scan column chunk
}
catch (ParquetDecodingException e) {
    if (e.getMessage().contains("Dictionary is missing for Page")) {
        logger.warn("Dictionary page missing; rewriting file without dictionary encoding");
        // fall back to a rewritten plain-encoded copy
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: readPageV1/readPageV2 -> initDataReader with dataEncoding.usesDictionary() == true and dictionary == null, which happens when the dictionary page was absent from the chunk metadata stream (dropped/skipped), dictionary decoding previously failed leaving dictionary null, or the writer marked pages dictionary-encoded without emitting the dictionary page.

Common situations: Truncated files where the dictionary page was lost but data pages remain; files whose footer/dictionary metadata is inconsistent (writer bugs or third-party tools rewriting files incorrectly); reading partial column chunks from object storage with inconsistent reads; a preceding 'could not decode the dictionary' failure leaving dictionary null.

Related errors


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