apache/iceberg · error · UnsupportedOperationException

readBinary is not supported

Error message

readBinary is not supported

What it means

readBinary(int len) in VectorizedValuesReader is a default method that throws UnsupportedOperationException; only concrete readers that decode binary (e.g. BYTE_ARRAY/VARCHAR) values override it. It is reached via nextVal() for binary columns or through buffer() callers when the active reader does not support binary reads. The interface throws deliberately so unimplemented type paths fail loudly.

Source

Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedValuesReader.java:80

  }

  /** Read a single float */
  default float readFloat() {
    throw new UnsupportedOperationException("readFloat is not supported");
  }

  /** Read a single double */
  default double readDouble() {
    throw new UnsupportedOperationException("readDouble is not supported");
  }

  /**
   * Read binary data of some length
   *
   * @param len The number of bytes to read
   */
  default Binary readBinary(int len) {
    throw new UnsupportedOperationException("readBinary is not supported");
  }

  /** Read `total` integers into `vec` starting at `vec[rowId]` */
  default void readIntegers(int total, FieldVector vec, int rowId) {
    throw new UnsupportedOperationException("readIntegers is not supported");
  }

  /** Read `total` longs into `vec` starting at `vec[rowId]` */
  default void readLongs(int total, FieldVector vec, int rowId) {
    throw new UnsupportedOperationException("readLongs is not supported");
  }

  /** Read `total` floats into `vec` starting at `vec[rowId]` */
  default void readFloats(int total, FieldVector vec, int rowId) {
    throw new UnsupportedOperationException("readFloats is not supported");
  }

  /** Read `total` doubles into `vec` starting at `vec[rowId]` */

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Disable vectorized reads (read.arrow.enabled=false) so binary columns use the standard Parquet value reader.
  2. Upgrade Iceberg to a version with vectorized binary/string support for your encoding.
  3. If you own the reader class, implement readBinary(int len) reading len bytes from the page input.

Example fix

// before
// default readBinary(len) throws
// after
@Override
public Binary readBinary(int len) { return Binary.fromConstantByteArray(readBytes(len)); }
Defensive patterns

Strategy: fallback

Validate before calling

// disable vectorized reads when schema has binary/string columns on old Iceberg
if (schema.columns().stream().anyMatch(c -> c.type() instanceof Types.StringType || c.type() instanceof Types.BinaryType) && !binaryVectorizedSupported) {
  props.put("read.arrow.enabled", "false");
}

Prevention

When it happens

Trigger: nextVal() or buffer() calls readBinary(len) for a Parquet BYTE_ARRAY column, but the active VectorizedValuesReader subclass (a fallback/base reader) does not override readBinary().

Common situations: Reading string/binary columns with vectorized reads enabled where the selected reader lacks binary support; Iceberg versions where vectorized reading covers only primitive numeric types (strings were unsupported in early vectorized readers); custom reader implementations.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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