apache/iceberg · error · UnsupportedOperationException

Unsupported task group for columnar reads: " + partition.tas

Error message

Unsupported task group for columnar reads: " + partition.taskGroup()

What it means

SparkColumnarReaderFactory.createColumnarReader throws UnsupportedOperationException when the input partition's task group is not composed entirely of FileScanTask, since columnar batch reading only handles file scan tasks.

Source

Thrown at spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/source/SparkColumnarReaderFactory.java:62

  @Override
  public PartitionReader<InternalRow> createReader(InputPartition inputPartition) {
    throw new UnsupportedOperationException("Row-based reads are not supported");
  }

  @Override
  public PartitionReader<ColumnarBatch> createColumnarReader(InputPartition inputPartition) {
    Preconditions.checkArgument(
        inputPartition instanceof SparkInputPartition,
        "Unknown input partition type: %s",
        inputPartition.getClass().getName());

    SparkInputPartition partition = (SparkInputPartition) inputPartition;

    if (partition.allTasksOfType(FileScanTask.class)) {
      return new BatchDataReader(partition, parquetConf, orcConf);
    } else {
      throw new UnsupportedOperationException(
          "Unsupported task group for columnar reads: " + partition.taskGroup());
    }
  }

  @Override
  public boolean supportColumnarReads(InputPartition inputPartition) {
    return true;
  }
}

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Ensure the read uses batch FileScanTask-based scans, not changelog tasks
  2. Check supportColumnarReads gating — do not force columnar reads for such partitions
  3. Use the row/changelog reader path instead
  4. Align Iceberg versions if task types changed internally
Defensive patterns

Strategy: type-guard

Validate before calling

if (!partition.allTasksOfType(FileScanTask.class)) { /* use row-based/changelog reader instead */ }

Type guard

boolean isColumnarReadable(SparkInputPartition p) { return p.allTasksOfType(FileScanTask.class); }

Try / catch

try { createColumnarReader(partition); } catch (UnsupportedOperationException e) { /* fall back to row-based reader */ }

Prevention

When it happens

Trigger: A SparkInputPartition whose taskGroup contains non-FileScanTask tasks (e.g. changelog or metadata tasks) reaches createColumnarReader.

Common situations: Reading changelog/streaming scans columnar-ly; mixed task groups after internal scan changes; custom scan task types.

Understand the failure class

Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.

Related errors


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