apache/iceberg · error · ParquetDecodingException
could not read page in col %s
Error message
could not read page in col %s
What it means
Wrapping error in PageIterator.initDataReader: values.initFromPage threw an IOException while binding the page's values reader to the current page; it is rethrown as a ParquetDecodingException naming the column (%s is the column descriptor/path). The cause is usually a truncated or corrupt data page in the Parquet file.
Source
Thrown at parquet/src/main/java/org/apache/iceberg/parquet/PageIterator.java:270
+ " as the dictionary was missing for encoding "
+ dataEncoding);
}
this.values =
dataEncoding.getDictionaryBasedValuesReader(desc, ValuesType.VALUES, dictionary);
} else {
this.values = dataEncoding.getValuesReader(desc, ValuesType.VALUES);
}
// if (dataEncoding.usesDictionary() && converter.hasDictionarySupport()) {
// bindToDictionary(dictionary);
// } else {
// bind(path.getType());
// }
try {
values.initFromPage(valueCount, in);
} catch (IOException e) {
throw new ParquetDecodingException("could not read page in col " + desc, e);
}
if (CorruptDeltaByteArrays.requiresSequentialReads(writerVersion, dataEncoding)
&& previousReader instanceof RequiresPreviousReader) {
// previous reader can only be set if reading sequentially
((RequiresPreviousReader) values).setPreviousReader(previousReader);
}
}
@Override
protected void initDefinitionLevelsReader(
DataPageV1 dataPageV1, ColumnDescriptor desc, ByteBufferInputStream in, int triplesCount)
throws IOException {
ValuesReader dlReader =
dataPageV1.getDlEncoding().getValuesReader(desc, ValuesType.DEFINITION_LEVEL);
this.definitionLevels = new ValuesReaderIntIterator(dlReader);
dlReader.initFromPage(triplesCount, in);
}View on GitHub (pinned to 86d9c8fc54)
Solutions
- Check storage/network stability and retry the read
- Validate the file integrity (size, checksums, parquet-tools)
- Re-copy or regenerate the corrupted file
Example fix
// before TableScan scan = table.newScan(); // fails on truncated file in storage // after // re-upload the data file, then retry the scan
Defensive patterns
Strategy: retry
Validate before calling
FSDataInputStream in = fs.open(path); long fileLen = fs.getFileStatus(path).getLen(); Preconditions.checkArgument(fileLen >= footerOffset, "File truncated: %s", path);
Try / catch
try {
readPages();
} catch (ParquetDecodingException e) {
if (e.getCause() instanceof IOException) { /* retry read or re-fetch file from storage */ }
else throw e;
} Prevention
- Use retries and checksums for object-storage reads (S3/GCS)
- Detect truncation by comparing local file size to source
- Avoid reading files while they are still being written
When it happens
Trigger: Calling initDataReader on a page whose underlying input stream throws IOException during initFromPage (e.g. truncated page data, read errors from storage).
Common situations: Truncated files; network/storage failures mid-read (S3, HDFS); bit-packed/RLE data inconsistent with the page header.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- Error reading mini block.
- Failed to read binary data
- could not read page " + valueCount + " in col " + desc
- Failed to read a byte
- Non-supported bytesWidth: " + bytesWidth
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/41dfa69888055e4c.
Report an issue: GitHub.