{"record":{"id":"92549a68ecec4057","repo":"apache/iceberg","slug":"could-not-read-page-valuecount-in-col","errorCode":null,"errorMessage":"could not read page \" + valueCount + \" in col \" + desc","messagePattern":"could not read page \" \\+ valueCount \\+ \" in col \" \\+ desc","errorType":"exception","errorClass":"ParquetDecodingException","httpStatus":null,"severity":"error","filePath":"arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedPageIterator.java","lineNumber":127,"sourceCode":"          break;\n        case BYTE_STREAM_SPLIT:\n          valuesReader =\n              new VectorizedByteStreamSplitValuesReader(\n                  byteStreamSplitElementSize(desc.getPrimitiveType()));\n          break;\n        default:\n          throw new UnsupportedOperationException(\n              \"Cannot support vectorized reads for column \"\n                  + desc\n                  + \" with \"\n                  + \"encoding \"\n                  + dataEncoding\n                  + \". Disable vectorized reads to read this table/file\");\n      }\n      try {\n        valuesReader.initFromPage(valueCount, in);\n      } catch (IOException e) {\n        throw new ParquetDecodingException(\n            \"could not read page \" + valueCount + \" in col \" + desc, e);\n      }\n      dictionaryDecodeMode = DictionaryDecodeMode.NONE;\n    }\n    if (CorruptDeltaByteArrays.requiresSequentialReads(writerVersion, dataEncoding)\n        && previousReader instanceof RequiresPreviousReader) {\n      // previous reader can only be set if reading sequentially\n      ((RequiresPreviousReader) valuesReader).setPreviousReader(previousReader);\n    }\n  }\n\n  public boolean producesDictionaryEncodedVector() {\n    return dictionaryDecodeMode == DictionaryDecodeMode.LAZY;\n  }\n\n  @Override\n  protected void initDefinitionLevelsReader(\n      DataPageV1 dataPageV1, ColumnDescriptor desc, ByteBufferInputStream in, int triplesCount)","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedPageIterator.java#L109-L145","documentation":"Thrown when the underlying Parquet page values cannot be read during vectorized reads. initDataReader initializes the page's ValuesReader inside a try block; any IOException reading the page stream is wrapped in a ParquetDecodingException with the value count and column descriptor. The library re-throws as a decoding exception because vectorized reads cannot recover from a corrupt or truncated page.","triggerScenarios":"Calling VectorizedPageIterator.initDataReader when valuesReader.initFromPage(valueCount, in) throws IOException — e.g. a truncated or corrupt Parquet data page, a bad page header offset, or I/O failure on the underlying input stream while switching to a new page.","commonSituations":"Reading files truncated by failed writes, downloading Parquet files from object storage with incomplete transfer, corrupted blocks on disk, or incompatible writer output producing malformed pages. The message suggests disabling vectorized reads as a fallback.","solutions":["Verify the file is complete/corruption-free (e.g. re-download, check checksums).","Re-read the file with vectorized reads disabled (set table property read.parquet.vectorization.enabled=false) which uses the slower non-vectorized path.","Check the Parquet writer version compatibility of the file producer.","Catch ParquetDecodingException and fall back to a row-by-row reader for that file."],"exampleFix":"// before\nTableScan scan = table.newScan();\n// after\nTableScan scan = table.newScan()\n    .option(TableProperties.PARQUET_VECTORIZATION_ENABLED, \"false\"); // fallback on corrupt pages","handlingStrategy":"fallback","validationCode":"// practical pre-check: file completeness via FileIO before scanning\nlong len = table.io().newInputFile(dataFile.location()).getLength();\nif (len == 0) { throw new IllegalStateException(\"Truncated data file: \" + dataFile.location()); }","typeGuard":null,"tryCatchPattern":"try {\n  rows = readVectorized(file);\n} catch (ParquetDecodingException e) {\n  LOG.warn(\"Vectorized read failed for {} — falling back\", file, e);\n  rows = readNonVectorized(file);\n}","preventionTips":["Validate data file integrity (checksums, complete uploads) before registering/reading files.","Set read.parquet.vectorization.enabled=false for files written by untrusted/legacy writers.","Catch ParquetDecodingException at the job level and implement a per-file row-reader fallback.","Keep writer and reader Parquet versions compatible; compact legacy files with current writers."],"tags":["parquet","io","decoding","vectorized-reads"],"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"}