{"record":{"id":"cbff95343d2736a8","repo":"apache/iceberg","slug":"classname-doesn-t-implement-setrowgroupinfo-pag","errorCode":null,"errorMessage":"${className} doesn't implement setRowGroupInfo(PageReadStore, Map<ColumnPath, ColumnChunkMetaData>)","messagePattern":"(.+?) doesn't implement setRowGroupInfo\\(PageReadStore, Map<ColumnPath, ColumnChunkMetaData>\\)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/VectorizedReader.java","lineNumber":47,"sourceCode":"  /**\n   * Reads a batch of type @param &lt;T&gt; and of size numRows\n   *\n   * @param reuse container for the last batch to be reused for next batch\n   * @param numRows number of rows to read\n   * @return batch of records of type @param &lt;T&gt;\n   */\n  T read(T reuse, int numRows);\n\n  void setBatchSize(int batchSize);\n\n  /**\n   * Sets the row group information to be used with this reader\n   *\n   * @param pages row group information for all the columns\n   * @param metadata map of {@link ColumnPath} -&gt; {@link ColumnChunkMetaData} for the row group\n   */\n  default void setRowGroupInfo(PageReadStore pages, Map<ColumnPath, ColumnChunkMetaData> metadata) {\n    throw new UnsupportedOperationException(\n        this.getClass().getName()\n            + \" doesn't implement setRowGroupInfo(PageReadStore, Map<ColumnPath, ColumnChunkMetaData>)\");\n  }\n\n  /** Release any resources allocated. */\n  void close();\n}\n","sourceCodeStart":29,"sourceCodeEnd":55,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/VectorizedReader.java#L29-L55","documentation":"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.","triggerScenarios":"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>).","commonSituations":"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.","solutions":["Override setRowGroupInfo in your VectorizedReader subclass to store PageReadStore and ColumnChunkMetaData for the row group","Use a built-in vectorized reader (e.g. VectorizedTableScanIterable readers) instead of a custom reader for vectorized scans","Disable vectorized reads so the non-vectorized reader path is used","Check that all columns in the projection are supported by the vectorized reader implementation"],"exampleFix":"// before\nclass MyReader implements VectorizedReader<ColumnarBatch> {\n  // setRowGroupInfo not overridden -> UnsupportedOperationException at runtime\n}\n// after\nclass MyReader implements VectorizedReader<ColumnarBatch> {\n  @Override\n  public void setRowGroupInfo(PageReadStore pages, Map<ColumnPath, ColumnChunkMetaData> metadata) {\n    this.pages = pages;\n    this.metadata = metadata;\n  }\n}","handlingStrategy":"try-catch","validationCode":"if (!supportsSetRowGroupInfo(reader.getClass())) {\n  throw new IllegalArgumentException(reader.getClass() + \" is not a vectorized reader\");\n}","typeGuard":"static boolean isVectorized(org.apache.iceberg.parquet.VectorizedReader<?> r) {\n  try {\n    java.lang.reflect.Method m = r.getClass().getDeclaredMethod(\"setRowGroupInfo\",\n        org.apache.parquet.column.page.PageReadStore.class, java.util.Map.class);\n    return !m.getDeclaringClass().equals(org.apache.iceberg.parquet.VectorizedReader.class);\n  } catch (NoSuchMethodException e) { return false; }\n}","tryCatchPattern":"try {\n  reader.setRowGroupInfo(pages, metadata);\n} catch (UnsupportedOperationException e) {\n  LOG.warn(\"Reader {} is not vectorized; falling back to non-vectorized read\", reader.getClass());\n  throw e;\n}","preventionTips":["Always override setRowGroupInfo when implementing VectorizedReader","Add an abstract base class test asserting row-group setup works before using custom readers","Keep custom readers aligned with the VectorizedReader interface of your Iceberg version","Prefer built-in vectorized readers unless the type genuinely needs custom batch handling"],"tags":["parquet","vectorized-reader","unsupported-operation"],"backgroundTag":"method-not-implemented","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}