apache/beam · error · UnsupportedOperationException

Unsupported task type: {}

Error message

Unsupported task type: {}

What it means

ChangelogScanner's bound computation derives lower/upper record-identifier bounds per task and switches on the task's concrete class; a class outside the supported set has no bound extraction, so the constructor path throws UnsupportedOperationException naming the simple class name.

Source

Thrown at sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/cdc/ChangelogScanner.java:783

                    "Upper and/or lower bounds are missing for %s with "
                        + "DataFile '%s' and DeleteFile '%s'",
                    task.getClass().getSimpleName(),
                    getDataFile(task).location(),
                    deleteFile.location()));
          }

          GenericRecord delFileLower = createRecId(recIdSchema, lowerDelBounds);
          GenericRecord delFileUpper = createRecId(recIdSchema, upperDelBounds);

          if (lowerId == null || idComp.compare(delFileLower, lowerId) < 0) {
            lowerId = delFileLower;
          }
          if (upperId == null || idComp.compare(delFileUpper, upperId) > 0) {
            upperId = delFileUpper;
          }
        }
      } else {
        throw new UnsupportedOperationException(
            "Unsupported task type: " + task.getClass().getSimpleName());
      }

      if (lowerId == null || upperId == null) {
        throw new NoBoundMetricsException(
            format(
                "Could not compute min and/or max bounds for %s with DataFile: %s",
                task.getClass().getSimpleName(), getDataFile(task).location()));
      }
      return new TaskAndBounds(task, lowerId, upperId);
    }

    /**
     * Compares itself with another task. If the bounds overlap, sets {@link #overlaps} to true for
     * both tasks.
     */
    private void checkOverlapWith(TaskAndBounds other, Comparator<StructLike> idComp) {
      if (overlaps && other.overlaps) {

View on GitHub (pinned to 12126d8942)

Solutions

  1. Align the Iceberg runtime version with the Beam CDC connector's expected version.
  2. Patch ChangelogScanner's bound-extraction switch to support the new task type and rebuild.
  3. Avoid enabling new Iceberg features on scanned tables, or fall back to a non-CDC incremental read.
  4. Run mvn dependency:tree to ensure only one consistent org.apache.iceberg version is present.

Example fix

// before
<dependency>iceberg-core:1.8.0</dependency> // new ChangelogScanTask subtype
// after
<dependency>iceberg-core:1.5.2</dependency> // supported by ChangelogScanner
Defensive patterns

Strategy: try-catch

Validate before calling

boolean known = task instanceof AddedRowsScanTask || task instanceof DeletedDataFileScanTask || task instanceof DeletedRowsScanTask;
if (!known) throw new UnsupportedOperationException("Unsupported task type for bound extraction");

Type guard

boolean supportsBounds(ChangelogScanTask t) {
  return t instanceof AddedRowsScanTask || t instanceof DeletedDataFileScanTask || t instanceof DeletedRowsScanTask;
}

Try / catch

try {
  TaskAndBounds bounds = TaskAndBounds.of(task, recIdSchema, idComp);
} catch (UnsupportedOperationException e) {
  if (e.getMessage().startsWith("Unsupported task type")) {
    throw new IllegalStateException("Use a connector version matching your Iceberg runtime: " + e.getMessage(), e);
  }
  throw e;
}

Prevention

When it happens

Trigger: TaskAndBounds computation (invoked from ChangelogScanner construction) encounters a task whose class is neither AddedRowsScanTask nor the handled delete task types — e.g. an unrecognized ChangelogScanTask subtype from a newer Iceberg runtime.

Common situations: Iceberg library version skew introducing new scan task types; classpath mixing multiple iceberg versions; tables using newly introduced changelog features read by an older connector.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/c97706ba617f0dde. Report an issue: GitHub.