{"record":{"id":"2d618113707196d4","repo":"apache/flink","slug":"unsupported-time-type","errorCode":null,"errorMessage":"Unsupported time type : {}","messagePattern":"Unsupported time type : (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"flink-datastream/src/main/java/org/apache/flink/datastream/impl/extension/window/utils/WindowUtils.java","lineNumber":87,"sourceCode":"                    \"Unsupported type of window strategy : \" + windowStrategy.getClass());\n        }\n    }\n\n    /** Create window assigner for global window. */\n    private static WindowAssigner<?, ?> createGlobalWindowAssigner() {\n        return GlobalWindows.createWithEndOfStreamTrigger();\n    }\n\n    /** Create window assigner for tumbling time window. */\n    private static WindowAssigner<?, ?> createTumblingTimeWindowAssigner(\n            TumblingTimeWindowStrategy windowStrategy) {\n        switch (windowStrategy.getTimeType()) {\n            case PROCESSING:\n                return TumblingProcessingTimeWindows.of(windowStrategy.getWindowSize());\n            case EVENT:\n                return TumblingEventTimeWindows.of(windowStrategy.getWindowSize());\n            default:\n                throw new IllegalArgumentException(\n                        \"Unsupported time type : \" + windowStrategy.getTimeType());\n        }\n    }\n\n    /** Create window assigner for sliding time window. */\n    private static WindowAssigner<?, ?> createSlidingTimeWindowAssigner(\n            SlidingTimeWindowStrategy windowStrategy) {\n        switch (windowStrategy.getTimeType()) {\n            case PROCESSING:\n                return SlidingProcessingTimeWindows.of(\n                        windowStrategy.getWindowSize(), windowStrategy.getWindowSlideInterval());\n            case EVENT:\n                return SlidingEventTimeWindows.of(\n                        windowStrategy.getWindowSize(), windowStrategy.getWindowSlideInterval());\n            default:\n                throw new IllegalArgumentException(\n                        \"Unsupported time type : \" + windowStrategy.getTimeType());\n        }","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-datastream/src/main/java/org/apache/flink/datastream/impl/extension/window/utils/WindowUtils.java#L69-L105","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before: time type from a mismatched API jar\nWindowStrategy.tumbling(size, someForeignTimeType);\n// after: constant resolved inside the same release\nWindowStrategy.tumbling(Duration.ofMinutes(1), WindowStrategy.TimeType.EVENT);","handlingStrategy":"validation","validationCode":"// verify the time type before composing a tumbling strategy\nstatic void checkTimeType(WindowStrategy.TimeType t) {\n    if (t != WindowStrategy.TimeType.PROCESSING && t != WindowStrategy.TimeType.EVENT) {\n        throw new IllegalArgumentException(\"Unsupported TimeType: \" + t\n                + \" - client/runtime Flink version skew?\");\n    }\n}","typeGuard":"static boolean isKnownTimeType(WindowStrategy.TimeType t) {\n    return t == WindowStrategy.TimeType.PROCESSING || t == WindowStrategy.TimeType.EVENT;\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["flink","datastream-v2","windowing","window-strategy","enum","version-mismatch","job-translation"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}