apache/iceberg · error · UnsupportedOperationException

${className} doesn't implement setRowGroupInfo(PageReadStore

Error message

${className} doesn't implement setRowGroupInfo(PageReadStore, Map<ColumnPath, ColumnChunkMetaData>)

What it means

VectorizedReader's default setRowGroupInfo implementation throws UnsupportedOperationException because vectorized reading requires concrete readers to consume row-group page and column-chunk metadata. The base interface only declares the contract; readers that are not vectorization-aware (or that forgot to override the default) cannot be driven by the batch/vectorized scan pipeline. It indicates a reader class was plugged into a vectorized read path without implementing the required row-group setup.

Source

Thrown at parquet/src/main/java/org/apache/iceberg/parquet/VectorizedReader.java:47

  /**
   * Reads a batch of type @param &lt;T&gt; and of size numRows
   *
   * @param reuse container for the last batch to be reused for next batch
   * @param numRows number of rows to read
   * @return batch of records of type @param &lt;T&gt;
   */
  T read(T reuse, int numRows);

  void setBatchSize(int batchSize);

  /**
   * Sets the row group information to be used with this reader
   *
   * @param pages row group information for all the columns
   * @param metadata map of {@link ColumnPath} -&gt; {@link ColumnChunkMetaData} for the row group
   */
  default void setRowGroupInfo(PageReadStore pages, Map<ColumnPath, ColumnChunkMetaData> metadata) {
    throw new UnsupportedOperationException(
        this.getClass().getName()
            + " doesn't implement setRowGroupInfo(PageReadStore, Map<ColumnPath, ColumnChunkMetaData>)");
  }

  /** Release any resources allocated. */
  void close();
}

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Override setRowGroupInfo in your VectorizedReader subclass to store PageReadStore and ColumnChunkMetaData for the row group
  2. Use a built-in vectorized reader (e.g. VectorizedTableScanIterable readers) instead of a custom reader for vectorized scans
  3. Disable vectorized reads so the non-vectorized reader path is used
  4. Check that all columns in the projection are supported by the vectorized reader implementation

Example fix

// before
class MyReader implements VectorizedReader<ColumnarBatch> {
  // setRowGroupInfo not overridden -> UnsupportedOperationException at runtime
}
// after
class MyReader implements VectorizedReader<ColumnarBatch> {
  @Override
  public void setRowGroupInfo(PageReadStore pages, Map<ColumnPath, ColumnChunkMetaData> metadata) {
    this.pages = pages;
    this.metadata = metadata;
  }
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!supportsSetRowGroupInfo(reader.getClass())) {
  throw new IllegalArgumentException(reader.getClass() + " is not a vectorized reader");
}

Type guard

static boolean isVectorized(org.apache.iceberg.parquet.VectorizedReader<?> r) {
  try {
    java.lang.reflect.Method m = r.getClass().getDeclaredMethod("setRowGroupInfo",
        org.apache.parquet.column.page.PageReadStore.class, java.util.Map.class);
    return !m.getDeclaringClass().equals(org.apache.iceberg.parquet.VectorizedReader.class);
  } catch (NoSuchMethodException e) { return false; }
}

Try / catch

try {
  reader.setRowGroupInfo(pages, metadata);
} catch (UnsupportedOperationException e) {
  LOG.warn("Reader {} is not vectorized; falling back to non-vectorized read", reader.getClass());
  throw e;
}

Prevention

When it happens

Trigger: Calling setRowGroupInfo on a VectorizedReader subclass that does not override the default method — e.g. a custom reader passed to a vectorized Spark scan, or a reader whose batched read path was enabled without implementing setRowGroupInfo(PageReadStore, Map<ColumnPath, ColumnChunkMetaData>).

Common situations: Custom VectorizedReader implementations used with vectorized-enabled reads (spark.sql.iceberg.handle-timestamp-without-timezone / vectorized reads enabled), version upgrades where the interface gained the metadata parameter, or accidentally using a generic reader where a vectorized one is required.

Related errors


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