prestodb/presto · error · PrestoException

PARQUET_IO_READ_ERROR

PARQUET_IO_READ_ERROR

Error message

Error reading Parquet column 

What it means

BinaryFlatBatchReader.readNext catches IOExceptions from reading a flat BINARY column chunk and rethrows them as a PrestoException with code PARQUET_IO_READ_ERROR, appending the ColumnDescriptor to the message and keeping the IOException as cause. Unlike the nested reader's generic message, this includes the column path, so you know exactly which column failed. It signals a low-level read problem, not a value-level decoding problem.

Source

Thrown at presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/BinaryFlatBatchReader.java:114

        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 ex) {
            throw new PrestoException(PARQUET_IO_READ_ERROR, "Error reading Parquet column " + columnDescriptor, ex);
        }

        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

  1. Read the caused-by exception: if it is a network/timeout error, retry the query — transient storage failures usually clear.
  2. Verify the file's integrity (size, parquet-tools footer/metadata read); restore or regenerate if corrupt or truncated.
  3. Check storage credentials and permissions — expired tokens mid-scan surface as IO read errors.
  4. If a specific host/datanode is failing, exclude it or fix the storage cluster before rerunning.
Defensive patterns

Strategy: retry

Validate before calling

// preflight: confirm the file is readable and non-truncated
ParquetMetadata footer = ParquetFileReader.readFooter(conf, new Path(path));
if (!fs.exists(new Path(path)) || fs.getFileStatus(new Path(path)).getLen() == 0) {
    throw new IllegalStateException("Missing or empty parquet file: " + path);
}

Try / catch

try {
    column = binaryReader.readNext();
} catch (PrestoException e) {
    if (PARQUET_IO_READ_ERROR.toErrorCode().getCode() == e.getErrorCode().getCode()
            && e.getCause() instanceof IOException
            && isRetryable((IOException) e.getCause())) {
        column = retryWithBackoff(binaryReader);
    } else { throw e; }
}

Prevention

When it happens

Trigger: readNext() on a binary flat column when readWithNull/readAnyNull (or underlying page/IO reads) throws IOException — failed HDFS/S3 read, corrupt page, checksum mismatch.

Common situations: Transient S3/HDFS connectivity errors during a scan; truncated or corrupted files; permissions/credentials expiring mid-read; disk errors on local cached data.

Related errors


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