apache/iceberg · error · UnsupportedOperationException

readShort is not supported

Error message

readShort is not supported

What it means

VectorizedValuesReader.readShort is a default interface method that throws UnsupportedOperationException. Short (2-byte) reads require an implementation that overrides this method; the default is a guard against unsupported reader types.

Solutions

  1. Use a values reader implementation that overrides readShort.
  2. Read via readInteger() and narrow to short in the caller.
  3. Override readShort in custom implementations.

Example fix

// before
short s = valuesReader.readShort(); // throws
// after
short s = (short) valuesReader.readInteger();
Defensive patterns

Strategy: type-guard

Validate before calling

if (typeWidth == 2 && !supportsShort(valuesReader)) { useGenericPath = true; }

Type guard

if (typeWidth == 2 && !overrides(valuesReader, "readShort")) {
  valuesReader = new StreamBackedValuesReader(...);
}

Prevention

When it happens

Trigger: Calling readShort() on a VectorizedValuesReader implementation that does not override it — typically when decoding an INT32 column into a 2-byte-width vector and the active reader lacks short support.

Common situations: Vectorized reads of 2-byte-width INT32 columns (e.g. smallint-backed data) via a reader that only implements full-width integer reads.

Related errors


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

Appendix: source

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

  int INT_SIZE = 4;
  int LONG_SIZE = 8;
  int FLOAT_SIZE = 4;
  int DOUBLE_SIZE = 8;

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

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

View on GitHub (pinned to 86d9c8fc54)