apache/iceberg · error · UnsupportedOperationException

readBoolean is not supported

Error message

readBoolean is not supported

What it means

The VectorizedValuesReader interface declares readBoolean as a default method that throws UnsupportedOperationException, because not all implementing readers support reading a single boolean value. A caller invoking readBoolean on an implementation that does not override it fails.

Solutions

  1. Use a values reader implementation that supports readBoolean (one that reads from the page stream).
  2. Check the column type/reader pairing before vectorized decoding; handle BOOLEAN with a supported reader.
  3. If implementing VectorizedValuesReader, override readBoolean.

Example fix

// before
class MyReader implements VectorizedValuesReader { /* no readBoolean */ }
// after
class MyReader implements VectorizedValuesReader {
  @Override public boolean readBoolean() { return (in.readInteger() & 1) != 0; }
}
Defensive patterns

Strategy: type-guard

Validate before calling

boolean isBool = desc.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.BOOLEAN;
boolean overridesRead = !VectorizedValuesReader.class.equals(
    valuesReader.getClass().getMethod("readBoolean").getDeclaringClass());

Type guard

static boolean supportsBoolean(VectorizedValuesReader r) throws NoSuchMethodException {
  return r.getClass().getMethod("readBoolean").getDeclaringClass() != VectorizedValuesReader.class;
}

Prevention

When it happens

Trigger: Calling VectorizedValuesReader.readBoolean() from a reader's nextVal path when the concrete values reader does not implement boolean reads — e.g. reading a BOOLEAN column through a reader implementation that lacks boolean support.

Common situations: Vectorized reads of BOOLEAN Parquet columns with a reader subclass that never overrode readBoolean (built-in implementations override it; custom or less-common implementations may not).

Related errors


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

Appendix: source

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

import org.apache.parquet.bytes.ByteBufferInputStream;
import org.apache.parquet.column.values.ValuesReader;
import org.apache.parquet.io.api.Binary;

/**
 * Interface for value decoding that supports vectorized (aka batched) decoding. Implementations are
 * expected to be {@link ValuesReader} instances, and this interface "extends" that abstract class
 * by overriding the salient methods.
 */
interface VectorizedValuesReader {

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

View on GitHub (pinned to 86d9c8fc54)