apache/flink · critical · IllegalArgumentException

Unsupported time type : {}

Error message

Unsupported time type : {}

What it means

createTumblingTimeWindowAssigner switches over WindowStrategy.getTimeType(), whose enum TimeType has exactly two constants, PROCESSING and EVENT. The default branch throws IllegalArgumentException naming the offending time type; with the current enum it is unreachable for normal constants and therefore indicates a TimeType instance the runtime does not know - i.e. version skew between flink-datastream-api and the runtime, or a locally modified enum.

Source

Thrown at flink-datastream/src/main/java/org/apache/flink/datastream/impl/extension/window/utils/WindowUtils.java:87

                    "Unsupported type of window strategy : " + windowStrategy.getClass());
        }
    }

    /** Create window assigner for global window. */
    private static WindowAssigner<?, ?> createGlobalWindowAssigner() {
        return GlobalWindows.createWithEndOfStreamTrigger();
    }

    /** Create window assigner for tumbling time window. */
    private static WindowAssigner<?, ?> createTumblingTimeWindowAssigner(
            TumblingTimeWindowStrategy windowStrategy) {
        switch (windowStrategy.getTimeType()) {
            case PROCESSING:
                return TumblingProcessingTimeWindows.of(windowStrategy.getWindowSize());
            case EVENT:
                return TumblingEventTimeWindows.of(windowStrategy.getWindowSize());
            default:
                throw new IllegalArgumentException(
                        "Unsupported time type : " + windowStrategy.getTimeType());
        }
    }

    /** Create window assigner for sliding time window. */
    private static WindowAssigner<?, ?> createSlidingTimeWindowAssigner(
            SlidingTimeWindowStrategy windowStrategy) {
        switch (windowStrategy.getTimeType()) {
            case PROCESSING:
                return SlidingProcessingTimeWindows.of(
                        windowStrategy.getWindowSize(), windowStrategy.getWindowSlideInterval());
            case EVENT:
                return SlidingEventTimeWindows.of(
                        windowStrategy.getWindowSize(), windowStrategy.getWindowSlideInterval());
            default:
                throw new IllegalArgumentException(
                        "Unsupported time type : " + windowStrategy.getTimeType());
        }

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Align flink-datastream-api and the cluster runtime to the same Flink release (check mvn dependency:tree and flink/lib).
  2. Construct strategies via the factories (WindowStrategy.tumbling(size, WindowStrategy.EVENT_TIME)) so the enum constant is resolved from the matching jar.
  3. If a genuinely new time semantic is needed, upgrade both jars to a Flink version that supports it; do not extend TimeType locally.
  4. Log windowStrategy.getTimeType() and its runtime class/version during job setup to detect skew early.

Example fix

// before: time type from a mismatched API jar
WindowStrategy.tumbling(size, someForeignTimeType);
// after: constant resolved inside the same release
WindowStrategy.tumbling(Duration.ofMinutes(1), WindowStrategy.TimeType.EVENT);
Defensive patterns

Strategy: validation

Validate before calling

// verify the time type before composing a tumbling strategy
static void checkTimeType(WindowStrategy.TimeType t) {
    if (t != WindowStrategy.TimeType.PROCESSING && t != WindowStrategy.TimeType.EVENT) {
        throw new IllegalArgumentException("Unsupported TimeType: " + t
                + " - client/runtime Flink version skew?");
    }
}

Type guard

static boolean isKnownTimeType(WindowStrategy.TimeType t) {
    return t == WindowStrategy.TimeType.PROCESSING || t == WindowStrategy.TimeType.EVENT;
}

Prevention

When it happens

Trigger: A TumblingTimeWindowStrategy whose getTimeType() returns something other than TimeType.PROCESSING/EVENT at runtime: a TimeType class from a newer API jar deserialized into an older runtime, reflection-fabricated enum constants, or a locally patched/extended TimeType enum in a custom build.

Common situations: Client compiled against a newer flink-datastream-api than the cluster's flink-dist; fat jars bundling one version while the cluster provides another; forks of Flink that extend TimeType without updating WindowUtils.

Related errors


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/2d618113707196d4. Report an issue: GitHub.