apache/iceberg · error · ParquetDecodingException

could not read page " + valueCount + " in col " + desc

Error message

could not read page " + valueCount + " in col " + desc

What it means

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.

Source

Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedPageIterator.java:127

          break;
        case BYTE_STREAM_SPLIT:
          valuesReader =
              new VectorizedByteStreamSplitValuesReader(
                  byteStreamSplitElementSize(desc.getPrimitiveType()));
          break;
        default:
          throw new UnsupportedOperationException(
              "Cannot support vectorized reads for column "
                  + desc
                  + " with "
                  + "encoding "
                  + dataEncoding
                  + ". Disable vectorized reads to read this table/file");
      }
      try {
        valuesReader.initFromPage(valueCount, in);
      } catch (IOException e) {
        throw new ParquetDecodingException(
            "could not read page " + valueCount + " in col " + desc, e);
      }
      dictionaryDecodeMode = DictionaryDecodeMode.NONE;
    }
    if (CorruptDeltaByteArrays.requiresSequentialReads(writerVersion, dataEncoding)
        && previousReader instanceof RequiresPreviousReader) {
      // previous reader can only be set if reading sequentially
      ((RequiresPreviousReader) valuesReader).setPreviousReader(previousReader);
    }
  }

  public boolean producesDictionaryEncodedVector() {
    return dictionaryDecodeMode == DictionaryDecodeMode.LAZY;
  }

  @Override
  protected void initDefinitionLevelsReader(
      DataPageV1 dataPageV1, ColumnDescriptor desc, ByteBufferInputStream in, int triplesCount)

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Verify the file is complete/corruption-free (e.g. re-download, check checksums).
  2. Re-read the file with vectorized reads disabled (set table property read.parquet.vectorization.enabled=false) which uses the slower non-vectorized path.
  3. Check the Parquet writer version compatibility of the file producer.
  4. Catch ParquetDecodingException and fall back to a row-by-row reader for that file.

Example fix

// before
TableScan scan = table.newScan();
// after
TableScan scan = table.newScan()
    .option(TableProperties.PARQUET_VECTORIZATION_ENABLED, "false"); // fallback on corrupt pages
Defensive patterns

Strategy: fallback

Validate before calling

// practical pre-check: file completeness via FileIO before scanning
long len = table.io().newInputFile(dataFile.location()).getLength();
if (len == 0) { throw new IllegalStateException("Truncated data file: " + dataFile.location()); }

Try / catch

try {
  rows = readVectorized(file);
} catch (ParquetDecodingException e) {
  LOG.warn("Vectorized read failed for {} — falling back", file, e);
  rows = readNonVectorized(file);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/92549a68ecec4057. Report an issue: GitHub.