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
- Align flink-datastream-api and the cluster runtime to the same Flink release (check mvn dependency:tree and flink/lib).
- Construct strategies via the factories (WindowStrategy.tumbling(size, WindowStrategy.EVENT_TIME)) so the enum constant is resolved from the matching jar.
- If a genuinely new time semantic is needed, upgrade both jars to a Flink version that supports it; do not extend TimeType locally.
- 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
- Pin client and cluster Flink versions identically
- Construct strategies via factories so enum constants resolve from one jar
- Avoid bundling flink-datastream-api in fat jars deployed to a cluster that provides its own
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
- Unsupported type of window strategy : {strategyClass}
- Window {window} is not in in-flight window set.
- The window uses a merging assigner, but the window state is
- The end timestamp of an event-time window cannot become earl
- The end timestamp of a processing-time window cannot become
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/2d618113707196d4.
Report an issue: GitHub.