{"record":{"id":"41dfa69888055e4c","repo":"apache/iceberg","slug":"could-not-read-page-in-col-s","errorCode":null,"errorMessage":"could not read page in col %s","messagePattern":"could not read page in col (.+?)","errorType":"exception","errorClass":"ParquetDecodingException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/PageIterator.java","lineNumber":270,"sourceCode":"                + \" as the dictionary was missing for encoding \"\n                + dataEncoding);\n      }\n      this.values =\n          dataEncoding.getDictionaryBasedValuesReader(desc, ValuesType.VALUES, dictionary);\n    } else {\n      this.values = dataEncoding.getValuesReader(desc, ValuesType.VALUES);\n    }\n\n    //    if (dataEncoding.usesDictionary() && converter.hasDictionarySupport()) {\n    //      bindToDictionary(dictionary);\n    //    } else {\n    //      bind(path.getType());\n    //    }\n\n    try {\n      values.initFromPage(valueCount, in);\n    } catch (IOException e) {\n      throw new ParquetDecodingException(\"could not read page in col \" + desc, e);\n    }\n\n    if (CorruptDeltaByteArrays.requiresSequentialReads(writerVersion, dataEncoding)\n        && previousReader instanceof RequiresPreviousReader) {\n      // previous reader can only be set if reading sequentially\n      ((RequiresPreviousReader) values).setPreviousReader(previousReader);\n    }\n  }\n\n  @Override\n  protected void initDefinitionLevelsReader(\n      DataPageV1 dataPageV1, ColumnDescriptor desc, ByteBufferInputStream in, int triplesCount)\n      throws IOException {\n    ValuesReader dlReader =\n        dataPageV1.getDlEncoding().getValuesReader(desc, ValuesType.DEFINITION_LEVEL);\n    this.definitionLevels = new ValuesReaderIntIterator(dlReader);\n    dlReader.initFromPage(triplesCount, in);\n  }","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/PageIterator.java#L252-L288","documentation":"Wrapping error in PageIterator.initDataReader: values.initFromPage threw an IOException while binding the page's values reader to the current page; it is rethrown as a ParquetDecodingException naming the column (%s is the column descriptor/path). The cause is usually a truncated or corrupt data page in the Parquet file.","triggerScenarios":"Calling initDataReader on a page whose underlying input stream throws IOException during initFromPage (e.g. truncated page data, read errors from storage).","commonSituations":"Truncated files; network/storage failures mid-read (S3, HDFS); bit-packed/RLE data inconsistent with the page header.","solutions":["Check storage/network stability and retry the read","Validate the file integrity (size, checksums, parquet-tools)","Re-copy or regenerate the corrupted file"],"exampleFix":"// before\nTableScan scan = table.newScan(); // fails on truncated file in storage\n// after\n// re-upload the data file, then retry the scan","handlingStrategy":"retry","validationCode":"FSDataInputStream in = fs.open(path); long fileLen = fs.getFileStatus(path).getLen(); Preconditions.checkArgument(fileLen >= footerOffset, \"File truncated: %s\", path);","typeGuard":null,"tryCatchPattern":"try {\n  readPages();\n} catch (ParquetDecodingException e) {\n  if (e.getCause() instanceof IOException) { /* retry read or re-fetch file from storage */ }\n  else throw e;\n}","preventionTips":["Use retries and checksums for object-storage reads (S3/GCS)","Detect truncation by comparing local file size to source","Avoid reading files while they are still being written"],"tags":["parquet","io","decoding"],"backgroundTag":"file-read-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}