{"record":{"id":"c0fa55937d1764d5","repo":"apache/iceberg","slug":"unsupported-task-group-for-columnar-reads-parti","errorCode":null,"errorMessage":"Unsupported task group for columnar reads: ${partition.taskGroup()}","messagePattern":"Unsupported task group for columnar reads: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkColumnarReaderFactory.java","lineNumber":62,"sourceCode":"\n  @Override\n  public PartitionReader<InternalRow> createReader(InputPartition inputPartition) {\n    throw new UnsupportedOperationException(\"Row-based reads are not supported\");\n  }\n\n  @Override\n  public PartitionReader<ColumnarBatch> createColumnarReader(InputPartition inputPartition) {\n    Preconditions.checkArgument(\n        inputPartition instanceof SparkInputPartition,\n        \"Unknown input partition type: %s\",\n        inputPartition.getClass().getName());\n\n    SparkInputPartition partition = (SparkInputPartition) inputPartition;\n\n    if (partition.allTasksOfType(FileScanTask.class)) {\n      return new BatchDataReader(partition, parquetConf, orcConf);\n    } else {\n      throw new UnsupportedOperationException(\n          \"Unsupported task group for columnar reads: \" + partition.taskGroup());\n    }\n  }\n\n  @Override\n  public boolean supportColumnarReads(InputPartition inputPartition) {\n    return true;\n  }\n}\n","sourceCodeStart":44,"sourceCodeEnd":72,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkColumnarReaderFactory.java#L44-L72","documentation":"createColumnarReader requires that every task in the input partition is a plain FileScanTask. If the task group contains other task types (e.g. combined delete/equality-delete tasks not suited to columnar reads), columnar reading cannot proceed and the factory fails fast with the task group description.","triggerScenarios":"Calling createColumnarReader on a SparkInputPartition whose taskGroup contains non-FileScanTask tasks, i.e. partition.allTasksOfType(FileScanTask.class) is false.","commonSituations":"Tables with equality deletes or mixed task types where Spark requests columnar reads (vectorized reader enabled); also custom scans producing non-file tasks.","solutions":["Fall back to row-based reads for these partitions or disable vectorized reads (spark.sql.iceberg.vectorized-reader.enabled=false).","Rewrite the table (e.g. rewrite_data_files / rewrite deletes) to remove equality deletes so all tasks are FileScanTasks.","Check the task group in the message to identify which scan produced the unsupported tasks."],"exampleFix":"// before\nspark.conf.set(\"spark.sql.iceberg.vectorized-reader.enabled\", \"true\") // fails on equality deletes\n// after\nspark.conf.set(\"spark.sql.iceberg.vectorized-reader.enabled\", \"false\")","handlingStrategy":"validation","validationCode":"// check for equality deletes before columnar read\nboolean hasEqDeletes = table.currentSnapshot() != null &&\n    !table.currentSnapshot().dataManifests(table.io()).stream()\n        .flatMap(m -> safe(m::deleteFilesCount).stream()) ... ; // or simply check spec/format","typeGuard":"if (!partition.allTasksOfType(FileScanTask.class)) { /* fall back to row reader */ }","tryCatchPattern":"try { reader = factory.createColumnarReader(p); } catch (UnsupportedOperationException e) { reader = rowReaderFor(p); }","preventionTips":["Rewrite tables to eliminate equality deletes before vectorized scans","Disable vectorized reader on tables with merge-on-read equality deletes","Monitor the task-group message to find scans emitting non-file tasks"],"tags":["spark","columnar","deletes","unsupported-operation"],"backgroundTag":"invalid-argument-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}