{"record":{"id":"df62bcc010905e9f","repo":"prestodb/presto","slug":"parquet-io-read-error-df62bc","errorCode":"PARQUET_IO_READ_ERROR","errorMessage":"Error reading Parquet column ","messagePattern":"Error reading Parquet column ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/Int32FlatBatchReader.java","lineNumber":109,"sourceCode":"        readOffset = readOffset + nextBatchSize;\n        nextBatchSize = batchSize;\n    }\n\n    @Override\n    public ColumnChunk readNext(Optional<DateTimeZone> timezone)\n    {\n        ColumnChunk columnChunk = null;\n        try {\n            seek();\n            if (field.isRequired()) {\n                columnChunk = readWithoutNull();\n            }\n            else {\n                columnChunk = readWithNull();\n            }\n        }\n        catch (IOException exception) {\n            throw new PrestoException(PARQUET_IO_READ_ERROR, \"Error reading Parquet column \" + columnDescriptor, exception);\n        }\n\n        readOffset = 0;\n        nextBatchSize = 0;\n        return columnChunk;\n    }\n\n    @Override\n    public long getRetainedSizeInBytes()\n    {\n        return INSTANCE_SIZE +\n                (definitionLevelDecoder == null ? 0 : definitionLevelDecoder.getRetainedSizeInBytes()) +\n                (valuesDecoder == null ? 0 : valuesDecoder.getRetainedSizeInBytes()) +\n                (dictionary == null ? 0 : dictionary.getRetainedSizeInBytes()) +\n                (pageReader == null ? 0 : pageReader.getRetainedSizeInBytes());\n    }\n\n    protected boolean readNextPage()","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/Int32FlatBatchReader.java#L91-L127","documentation":"Int32FlatBatchReader.readNext wraps any IOException raised while decoding pages (page reading, definition-level or value decoding) into a PrestoException with code PARQUET_IO_READ_ERROR, adding the column descriptor for context. It signals an I/O or decoding failure while reading a specific Parquet column, not a data-value problem.","triggerScenarios":"Any IOException thrown from pageReader.readPage(), readFlatPage, or the underlying value/definition decoders during readNext of an int32 column chunk — e.g. failure decompressing a page, reading from a broken HDFS/S3 stream, or a decoder error surfaced as IOException.","commonSituations":"Network interruption while streaming a Parquet file from S3/HDFS; checksum failures on a block; unsupported compression codec or corrupted page that the underlying reader reports as an I/O failure.","solutions":["Inspect the cause chain (getCause()) to find the real I/O problem and fix the storage/network issue","Retry the query — transient HDFS/S3 errors are the most common cause","Verify the file is not truncated or corrupt (parquet-tools / table regeneration)","Check compression codec support; upgrade Presto if the file uses a newer codec (e.g. newer ZSTD)"],"exampleFix":"// before: confusing wrapped error\nthrow new PrestoException(PARQUET_IO_READ_ERROR, \"Error reading Parquet column \" + columnDescriptor, e);\n// after: log the cause for diagnosis\nlog.error(e.getCause(), \"Underlying failure reading %s\", columnDescriptor);\nthrow new PrestoException(PARQUET_IO_READ_ERROR, \"Error reading Parquet column \" + columnDescriptor, e);","handlingStrategy":"try-catch","validationCode":"// pre-check object accessibility\nFileStatus st = fs.getFileStatus(path);\nif (!fs.open(path).read() ... /* or check length > 0 and footer readable */)","typeGuard":null,"tryCatchPattern":"try {\n    reader.readNext();\n} catch (PrestoException e) {\n    if (e.getErrorCode() == PARQUET_IO_READ_ERROR) {\n        retryWithBackoff();\n    } else {\n        throw e;\n    }\n}","preventionTips":["Retry transient HDFS/S3 errors with backoff","Check checksums to catch corruption early","Verify compression codec support before querying files","Log the exception cause chain for diagnosis"],"tags":["parquet","io","hdfs","s3"],"backgroundTag":"parquet-io-read-error","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}