{"record":{"id":"c95228cd745132c8","repo":"apache/flink","slug":"key-types-if-input-keyedstreams-don-t-match-an","errorCode":null,"errorMessage":"Key types if input KeyedStreams don't match: {} and {}.","messagePattern":"Key types if input KeyedStreams don't match: (.+?) and (.+?)\\.","errorType":"validation","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink-datastream/src/main/java/org/apache/flink/datastream/impl/utils/StreamUtils.java","lineNumber":351,"sourceCode":"\n        TypeInformation<?> keyType = null;\n        if (inputStream1 instanceof KeyedPartitionStreamImpl) {\n            KeyedPartitionStreamImpl<?, IN1> keyedInput1 =\n                    (KeyedPartitionStreamImpl<?, IN1>) inputStream1;\n\n            keyType = keyedInput1.getKeyType();\n\n            transform.setStateKeySelectors(keyedInput1.getKeySelector(), null);\n            transform.setStateKeyType(keyType);\n        }\n        if (inputStream2 instanceof KeyedPartitionStreamImpl) {\n            KeyedPartitionStreamImpl<?, IN2> keyedInput2 =\n                    (KeyedPartitionStreamImpl<?, IN2>) inputStream2;\n\n            TypeInformation<?> keyType2 = keyedInput2.getKeyType();\n\n            if (keyType != null && !(keyType.canEqual(keyType2) && keyType.equals(keyType2))) {\n                throw new UnsupportedOperationException(\n                        \"Key types if input KeyedStreams \"\n                                + \"don't match: \"\n                                + keyType\n                                + \" and \"\n                                + keyType2\n                                + \".\");\n            }\n\n            transform.setStateKeySelectors(\n                    transform.getStateKeySelector1(), keyedInput2.getKeySelector());\n\n            // we might be overwriting the one that's already set, but it's the same\n            transform.setStateKeyType(keyType2);\n        }\n\n        return transform;\n    }\n","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-datastream/src/main/java/org/apache/flink/datastream/impl/utils/StreamUtils.java#L333-L369","documentation":"Error \"Key types if input KeyedStreams don't match: {} and {}.\" thrown in apache/flink.","triggerScenarios":"Triggered at runtime when the operation fails because: Key types if input KeyedStreams don't match: the reported value and the reported value.","commonSituations":"Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: Key types if input KeyedStreams don't match: the reported value and the reported value.","solutions":["Address the cause reported by the error message: Key types if input KeyedStreams don't match: the reported value and the reported value.","Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry."],"exampleFix":"Correct the condition described (\"Key types if input KeyedStreams don't match: the reported value and the reported value.\") and rerun the job or command.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}