{"record":{"id":"53584331657892aa","repo":"apache/flink","slug":"could-not-determine-type-information-from-inputs","errorCode":null,"errorMessage":"Could not determine type information from inputs.","messagePattern":"Could not determine type information from inputs\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/api/common/operators/Operator.java","lineNumber":252,"sourceCode":"     * @param input1 The first input operator.\n     * @param input2 The other input operators.\n     * @return The single operator or a cascade of unions of the operators.\n     */\n    public static <T> Operator<T> createUnionCascade(Operator<T> input1, Operator<T>... input2) {\n        // return cases where we don't need a union\n        if (input2 == null || input2.length == 0) {\n            return input1;\n        } else if (input2.length == 1 && input1 == null) {\n            return input2[0];\n        }\n\n        TypeInformation<T> type = null;\n        if (input1 != null) {\n            type = input1.getOperatorInfo().getOutputType();\n        } else if (input2.length > 0 && input2[0] != null) {\n            type = input2[0].getOperatorInfo().getOutputType();\n        } else {\n            throw new IllegalArgumentException(\"Could not determine type information from inputs.\");\n        }\n\n        // Otherwise construct union cascade\n        Union<T> lastUnion =\n                new Union<T>(new BinaryOperatorInformation<T, T, T>(type, type, type), \"<unknown>\");\n\n        int i;\n        if (input2[0] == null) {\n            throw new IllegalArgumentException(\"The input may not contain null elements.\");\n        }\n        lastUnion.setFirstInput(input2[0]);\n\n        if (input1 != null) {\n            lastUnion.setSecondInput(input1);\n            i = 1;\n        } else {\n            if (input2[1] == null) {\n                throw new IllegalArgumentException(\"The input may not contain null elements.\");","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/common/operators/Operator.java#L234-L270","documentation":"Thrown by Operator.createUnionCascade when no output type can be determined from any input. The method tries input1 then input2[0] to infer the common type for the Union operators; if both are null (and input2 has length>0 but input2[0] is also null), type inference has nothing to work with. This indicates all provided operators are null in a context that expected at least one typed operator.","triggerScenarios":"Calling createUnionCascade(null, null, null) or createUnionCascade(nullOperator, nullOperator). Reaching the union-cascade logic with every source operator null.","commonSituations":"Building a union from a dynamically generated list that is all-null due to upstream failures. Legacy operator-graph construction code that passes null placeholders.","solutions":["Ensure at least one non-null Operator with resolvable output type is passed.","Filter nulls from the operators list before calling createUnionCascade.","If input1 is legitimately null, guarantee input2[0] is non-null and typed."],"exampleFix":"// before\nOperator<T>[] ops = filterNulls(maybeWithNulls);\nOperator.createUnionCascade(null, ops);  // ops[0] could be null\n\n// after\nOperator<T>[] ops = Arrays.stream(maybeWithNulls)\n    .filter(Objects::nonNull)\n    .toArray(Operator[]::new);\nif (ops.length == 0) throw new IllegalStateException(\"no operators to union\");\nOperator.createUnionCascade(null, ops);","handlingStrategy":"validation","validationCode":"if ((input1 == null)\n        && (input2 == null || input2.length == 0 || input2[0] == null)) {\n    throw new IllegalArgumentException(\n        \"At least one non-null typed operator is required.\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure at least one operator with resolvable output type is non-null.","Filter nulls from operator lists before unioning.","Fail fast with a clear message if all operators are null."],"tags":["operators","null-check","union","flink-core"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}