apache/iceberg · error · UncheckedIOException

Failed to read binary data

Error message

Failed to read binary data

What it means

VectorizedDeltaLengthByteArrayValuesReader.readBinary reads the length-prefixed binary value (DELTA_LENGTH_BYTE_ARRAY encoding) from the buffered byte stream. An IOException while getting the length or copying bytes is wrapped in UncheckedIOException with this message. It means the encoded binary data could not be read from the page buffer.

Source

Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedDeltaLengthByteArrayValuesReader.java:70

  int lengthForCurrentRow() {
    return lengths[currentRow];
  }

  @Override
  public Binary readBinary(int len) {
    try {
      ByteBuffer buffer = dataStream.slice(len);
      this.currentRow++;
      if (buffer.hasArray()) {
        return Binary.fromConstantByteArray(
            buffer.array(), buffer.arrayOffset() + buffer.position(), len);
      } else {
        byte[] bytes = new byte[len];
        buffer.get(bytes);
        return Binary.fromConstantByteArray(bytes);
      }
    } catch (IOException e) {
      throw new UncheckedIOException("Failed to read binary data", e);
    }
  }

  @Override
  public int readInteger() {
    return lengths[currentRow];
  }

  @Override
  public void skip() {
    throw new UnsupportedOperationException("skip is not supported");
  }
}

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Retry the scan to rule out transient storage IO errors.
  2. Validate the Parquet file and rewrite corrupted files from source data.
  3. Upgrade/fix the writer that produced DELTA_LENGTH_BYTE_ARRAY-encoded files.
  4. Disable vectorized reads to use the standard Parquet reader as a workaround.
Defensive patterns

Strategy: retry

Try / catch

try {
  // vectorized read
} catch (UncheckedIOException e) {
  if (e.getMessage().equals("Failed to read binary data") && isTransient(e.getCause()) && attempt < maxAttempts) {
    // retry scan
  } else throw e;
}

Prevention

When it happens

Trigger: readBinary (or readBytes) encounters IOException while reading a length-prefixed string/binary value from the page's input buffer.

Common situations: Corrupted or truncated data pages holding delta-length-encoded strings/binary columns, or buffer underflow from misaligned decoding state.

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/47b09651850282c0. Report an issue: GitHub.