prestodb/presto · error · PrestoException
PARQUET_IO_READ_ERROR
PARQUET_IO_READ_ERROR
Error message
Error reading Parquet column
What it means
This PrestoException (PARQUET_IO_READ_ERROR) wraps any IOException thrown while UuidFlatBatchReader.readNext() reads values for a UUID-typed Parquet column chunk. The library throws it to convert low-level I/O failures (HDFS/S3/local reads, stream truncation) into a typed Presto error that identifies the failing column. The original IOException is preserved as the cause.
Source
Thrown at presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/UuidFlatBatchReader.java:110
readOffset = readOffset + nextBatchSize;
nextBatchSize = batchSize;
}
@Override
public ColumnChunk readNext(Optional<DateTimeZone> timezone)
{
ColumnChunk columnChunk = null;
try {
seek();
if (field.isRequired()) {
columnChunk = readWithoutNull();
}
else {
columnChunk = readWithNull();
}
}
catch (IOException exception) {
throw new PrestoException(PARQUET_IO_READ_ERROR, "Error reading Parquet column " + columnDescriptor, exception);
}
readOffset = 0;
nextBatchSize = 0;
return columnChunk;
}
@Override
public long getRetainedSizeInBytes()
{
return INSTANCE_SIZE +
(definitionLevelDecoder == null ? 0 : definitionLevelDecoder.getRetainedSizeInBytes()) +
(valuesDecoder == null ? 0 : valuesDecoder.getRetainedSizeInBytes()) +
(dictionary == null ? 0 : dictionary.getRetainedSizeInBytes()) +
(pageReader == null ? 0 : pageReader.getRetainedSizeInBytes());
}
protected boolean readNextPage()View on GitHub (pinned to 55bb57d202)
Solutions
- Check the wrapped IOException cause to identify the true I/O failure (connection, permission, truncation).
- Verify the Parquet file is complete and readable (file size vs footer-declared bytes; re-upload/re-copy if truncated).
- Retry transient network failures at the storage layer or re-run the query; enable retries on S3/HDFS client.
- If reproducible, validate the file with a Parquet tool (parquet-tools) to confirm corruption.
- Confirm no version mismatch between reader and writer producing unreadable encodings.
Example fix
// before
ColumnChunk chunk = reader.readNext(); // throws PARQUET_IO_READ_ERROR on truncated file
// after
try {
ColumnChunk chunk = reader.readNext();
} catch (PrestoException e) {
if (e.getErrorCode().getName().equals("PARQUET_IO_READ_ERROR")) {
// inspect e.getCause() IOException; re-fetch/validate the file before retry
}
throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
// before reading, verify file completeness
long footerLen = 8;
if (dataSource.readFileSize() < footerLen) throw new IllegalStateException("Parquet file truncated: " + path);
Try / catch
try {
ColumnChunk chunk = reader.readNext();
} catch (PrestoException e) {
if (e.getErrorCode().getName().equals("PARQUET_IO_READ_ERROR") && e.getCause() instanceof IOException) {
// inspect cause; retry transient storage failures, else fail with path context
}
throw e;
} Prevention
- Validate file completeness (footer present, size matches) before scanning
- Enable S3/HDFS client retries for transient I/O
- Use checksummed/committed output (e.g., S3 multipart commit) when writing Parquet
- Log file path and offset with the error for triage
When it happens
Trigger: Calling readNext() on a UUID flat batch reader when the underlying ParquetDataSource throws IOException: truncated file, network/hdfs read failure, closed stream, or corrupted chunk metadata that makes the underlying reader fail mid-read.
Common situations: Reading a Parquet file that was truncated by a failed job or incomplete S3 upload; HDFS/S3 network instability during scan; a file written by a buggy producer with chunk sizes exceeding actual bytes.
Related errors
- HUDI_CANNOT_OPEN_SPLIT
- PARQUET_IO_READ_ERROR
- HIVE_FILESYSTEM_ERROR
- UncheckedIOException
- HUDI_CANNOT_OPEN_SPLIT
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/1dd0175fce7daab4.
Report an issue: GitHub.