apache/iceberg · error · UnsupportedOperationException

readLong is not supported

Error message

readLong is not supported

What it means

VectorizedValuesReader is an interface whose default methods are intentionally unimplemented; each concrete reader subclass overrides only the methods its data type actually needs. readLong() hits the default implementation when the selected concrete reader does not support reading single long values. This is a programming/configuration mismatch: the vectorized Parquet decoder is being asked to perform an operation its implementation class never implemented.

Source

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

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

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

  /** Read a single integer */
  default int readInteger() {
    throw new UnsupportedOperationException("readInteger is not supported");
  }

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

  /** 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) {

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Disable vectorized reads for the table/read path (e.g. unset read.arrow.enabled / arrow-enabled=false) so the fallback Parquet row reader is used.
  2. Check that the column's physical type is one supported by vectorized reading for your Iceberg version; upgrade Iceberg if support was added later.
  3. If implementing a custom VectorizedValuesReader, override readLong() instead of inheriting the default.

Example fix

// before (custom reader)
class MyReader implements VectorizedValuesReader { ... }
// after
class MyReader implements VectorizedValuesReader {
  @Override
  public long readLong() { return buffer.getLong(offset); }
}
Defensive patterns

Strategy: fallback

Validate before calling

// before scanning with vectorized reads
if (columnType != Types.LongType.get() || !vectorizedSupports(type, version)) {
  readProps.put("read.arrow.enabled", "false");
}

Prevention

When it happens

Trigger: A DefaultVectorizedReader (or similar fallback subclass) is selected for the column's Parquet physical type, and VectorizedPageReader.nextVal() dispatches to readLong() for a LONG-annotated column. Happens when vectorized reading is enabled for a type combination whose reader class only implements the integer paths.

Common situations: Reading a Parquet long column with vectorized reads enabled where the reader factory chose a base/unsupported reader; custom or newly added physical-type support where the concrete reader forgot to override readLong; running with an Iceberg version where that type's vectorized support is not yet implemented.

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