apache/iceberg · error · IllegalArgumentException

Invalid operator event type: ${eventType}

Error message

Invalid operator event type: ${eventType}

What it means

DataStatisticsCoordinator.handleEventFromOperator processes OperatorEvents sent from upstream subtasks during the shuffle data-statistics protocol. Only StatisticsEvent and RequestGlobalStatisticsEvent are recognized; any other event type is rejected. This is a defensive check against protocol mismatches between operator and coordinator.

Source

Thrown at flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/shuffle/DataStatisticsCoordinator.java:322

    }
  }

  @Override
  public void handleEventFromOperator(int subtask, int attemptNumber, OperatorEvent event) {
    runInCoordinatorThread(
        () -> {
          LOG.debug(
              "Handling event from subtask {} (#{}) of {}: {}",
              subtask,
              attemptNumber,
              operatorName,
              event);
          if (event instanceof StatisticsEvent) {
            handleDataStatisticRequest(subtask, ((StatisticsEvent) event));
          } else if (event instanceof RequestGlobalStatisticsEvent) {
            handleRequestGlobalStatisticsEvent(subtask, (RequestGlobalStatisticsEvent) event);
          } else {
            throw new IllegalArgumentException(
                "Invalid operator event type: " + event.getClass().getCanonicalName());
          }
        },
        String.format(
            Locale.ROOT,
            "handling operator event %s from subtask %d (#%d)",
            event.getClass(),
            subtask,
            attemptNumber));
  }

  @Override
  public void checkpointCoordinator(long checkpointId, CompletableFuture<byte[]> resultFuture) {
    runInCoordinatorThread(
        () -> {
          LOG.debug(
              "Snapshotting data statistics coordinator {} for checkpoint {}",
              operatorName,

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Ensure all TaskManager nodes use the same Iceberg connector version (check the job classpath/uber-jar).
  2. Fully restart the job rather than hot-swapping jars so event protocol versions match.
  3. If adding custom events, extend the coordinator's handler instead of reusing this one.
Defensive patterns

Strategy: type-guard

Validate before calling

if (!(event instanceof StatisticsEvent) && !(event instanceof RequestGlobalStatisticsEvent)) {
  throw new IllegalArgumentException("Unsupported operator event for DataStatisticsCoordinator: " + event.getClass().getName());
}

Type guard

boolean isHandledEvent(OperatorEvent e) {
  return e instanceof StatisticsEvent || e instanceof RequestGlobalStatisticsEvent;
}

Try / catch

try {
  coordinator.handleEventFromOperator(subtask, event, index);
} catch (IllegalArgumentException e) {
  if (e.getMessage().startsWith("Invalid operator event type")) {
    LOG.warn("Ignoring unknown operator event {} — check for version skew", event.getClass().getName());
  } else throw e;
}

Prevention

When it happens

Trigger: Sending a custom/unknown OperatorEvent to the coordinator, or mismatched connector versions where one side emits an event type the other does not recognize.

Common situations: Mixing Iceberg connector jar versions within one Flink job (e.g. different versions on coordinator and operator classpaths), or custom operator event injection in tests/patches.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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