apache/iceberg · error · ParquetDecodingException

Read failure possibly due to PARQUET-246: try setting parque

Error message

Read failure possibly due to PARQUET-246: try setting parquet.split.files to false (caused by: Can't read value in column %s at value %d out of %d in current page. repetition level: %d, definition level: %d)

What it means

PageIterator.nextBoolean wraps any RuntimeException thrown while decoding a boolean page value into a RuntimeException referencing the known Parquet bug PARQUET-246, in which task/file splitting can corrupt v1 page reading. The inner message reports the column path, the value ordinal within the page, and the current repetition/definition levels so you can identify the corrupt position. Iceberg rethrows it with this hint because the usual remedy is to disable split-file reads rather than assume the data is unreadable.

Source

Thrown at parquet/src/main/java/org/apache/iceberg/parquet/PageIterator.java:132

  @Override
  public int currentDefinitionLevel() {
    Preconditions.checkArgument(currentDL >= 0, "Should not read definition, past page end");
    return currentDL;
  }

  @Override
  public int currentRepetitionLevel() {
    //    Preconditions.checkArgument(currentDL >= 0, "Should not read repetition, past page end");
    return currentRL;
  }

  @Override
  public boolean nextBoolean() {
    advance();
    try {
      return values.readBoolean();
    } catch (RuntimeException e) {
      throw handleRuntimeException(e);
    }
  }

  @Override
  public int nextInteger() {
    advance();
    try {
      return values.readInteger();
    } catch (RuntimeException e) {
      throw handleRuntimeException(e);
    }
  }

  @Override
  public long nextLong() {
    advance();
    try {
      return values.readLong();

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Set the read property parquet.split.files=false (e.g., spark.sql.files.maxPartitionBytes tuning aside, or table read property split-size very large) so a page is not read across a split boundary
  2. Verify the file is not truncated: compare file size/checksum against the manifest and re-copy the data file
  3. Rewrite the affected data files with a current Parquet/Iceberg writer version to regenerate pages
  4. Catch the exception, log the column and value position, and fall back to a non-split read of that file

Example fix

// before (default)
// spark reads parquet with splits enabled; mid-page reads can fail
// after
spark.conf.set("parquet.split.files", "false")
// or on the Iceberg read options
// table scan option: split-size large enough to avoid mid-page splits
Defensive patterns

Strategy: try-catch

Validate before calling

// validate file integrity before scanning
TableScan scan = table.newScan();
FileIO io = table.io();
for (FileScanTask task : scan.planFiles()) {
  ContentFile<?> f = task.file();
  if (io.newInputFile(f.location()).getLength() != f.fileSizeInBytes()) {
    throw new IllegalStateException("Truncated data file: " + f.location());
  }
}

Try / catch

try {
  iterator.next();
} catch (RuntimeException e) {
  if (e.getMessage() != null && e.getMessage().contains("PARQUET-246")) {
    // re-read this file with splits disabled (parquet.split.files=false) or large split-size
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: Reading a Parquet boolean column via the iceberg-parquet vectorized/arrow-free path when the page decoder's values buffer is exhausted or misaligned (value N out of M in the current page), typically after a row-group split mid-page (PARQUET-246) or a truncated/corrupt page produced by an older writer.

Common situations: Query engines (Spark/Flink) scanning a split of a v1 Parquet file where a page straddles the split boundary; files written by an old Parquet version; truncated files from failed uploads; reading with parquet.split.files enabled (default true).

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/5b0ebb68798fa170. Report an issue: GitHub.