{"record":{"id":"607e3482a4855029","repo":"prestodb/presto","slug":"parquet-io-read-error-607e34","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/Int64FlatBatchReader.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/Int64FlatBatchReader.java#L91-L127","documentation":"Int64FlatBatchReader.readNext wraps any IOException raised while reading or decoding pages of an int64 column chunk into a PrestoException with code PARQUET_IO_READ_ERROR, including the column descriptor. It indicates an I/O or underlying-decoder failure, not a logic error in the caller.","triggerScenarios":"IOException from pageReader.readPage(), readFlatPage, or the int64 value/definition decoders during readNext — e.g. decompression failure, broken stream from HDFS/S3, checksum mismatch.","commonSituations":"Transient storage/network failures streaming Parquet from S3 or HDFS; corrupted or truncated pages; unsupported compression codec in the file.","solutions":["Inspect the cause (getCause()) to identify the underlying I/O error and address it","Retry the query for transient storage errors","Validate file integrity; regenerate truncated/corrupt files","Check codec support; upgrade Presto if the file uses an unsupported/newer compression codec"],"exampleFix":"// before\nchunk = reader.readNext(); // wrapped error loses context\n// after\ntry {\n    chunk = reader.readNext();\n} catch (PrestoException e) {\n    log.error(e.getCause(), \"failed reading %s\", column);\n    throw e;\n}","handlingStrategy":"try-catch","validationCode":"// ensure the stream is readable before decoding\ntry (InputStream in = fs.open(path)) {\n    if (in.read() == -1) throw new IOException(\"empty file\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    reader.readNext();\n} catch (PrestoException e) {\n    if (PARQUET_IO_READ_ERROR.equals(e.getErrorCode().getName())) {\n        retryQueryWithBackoff();\n    } else throw e;\n}","preventionTips":["Retry transient IO errors with exponential backoff","Monitor storage health (HDFS datanode errors, S3 5xx)","Validate file footers before splits are scheduled","Upgrade Presto for codec/decoder fixes"],"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"}