{"record":{"id":"4c815118c231f2c6","repo":"prestodb/presto","slug":"parquet-io-read-error","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/BinaryFlatBatchReader.java","lineNumber":114,"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 ex) {\n            throw new PrestoException(PARQUET_IO_READ_ERROR, \"Error reading Parquet column \" + columnDescriptor, ex);\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":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-parquet/src/main/java/com/facebook/presto/parquet/batchreader/BinaryFlatBatchReader.java#L96-L132","documentation":"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.","triggerScenarios":"readNext() on a binary flat column when readWithNull/readAnyNull (or underlying page/IO reads) throws IOException — failed HDFS/S3 read, corrupt page, checksum mismatch.","commonSituations":"Transient S3/HDFS connectivity errors during a scan; truncated or corrupted files; permissions/credentials expiring mid-read; disk errors on local cached data.","solutions":["Read the caused-by exception: if it is a network/timeout error, retry the query — transient storage failures usually clear.","Verify the file's integrity (size, parquet-tools footer/metadata read); restore or regenerate if corrupt or truncated.","Check storage credentials and permissions — expired tokens mid-scan surface as IO read errors.","If a specific host/datanode is failing, exclude it or fix the storage cluster before rerunning."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// preflight: confirm the file is readable and non-truncated\nParquetMetadata footer = ParquetFileReader.readFooter(conf, new Path(path));\nif (!fs.exists(new Path(path)) || fs.getFileStatus(new Path(path)).getLen() == 0) {\n    throw new IllegalStateException(\"Missing or empty parquet file: \" + path);\n}","typeGuard":null,"tryCatchPattern":"try {\n    column = binaryReader.readNext();\n} catch (PrestoException e) {\n    if (PARQUET_IO_READ_ERROR.toErrorCode().getCode() == e.getErrorCode().getCode()\n            && e.getCause() instanceof IOException\n            && isRetryable((IOException) e.getCause())) {\n        column = retryWithBackoff(binaryReader);\n    } else { throw e; }\n}","preventionTips":["Enable retry policies on S3/HDFS clients with sensible backoff.","Validate credentials/TTLs so tokens outlast long scans.","Checksum data after writes and replicate important files."],"tags":["parquet","io","binary-column","storage"],"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-12T02:17:10.037Z"}