{"record":{"id":"e3be073efb4ac23e","repo":"apache/flink","slug":"the-missing-type-information-cannot-be-used-as-a-t","errorCode":null,"errorMessage":"The missing type information cannot be used as a type information.","messagePattern":"The missing type information cannot be used as a type information\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/api/java/typeutils/MissingTypeInfo.java","lineNumber":60,"sourceCode":"        this.functionName = functionName;\n        this.typeException = typeException;\n    }\n\n    // --------------------------------------------------------------------------------------------\n\n    public String getFunctionName() {\n        return functionName;\n    }\n\n    public InvalidTypesException getTypeException() {\n        return typeException;\n    }\n\n    // --------------------------------------------------------------------------------------------\n\n    @Override\n    public boolean isBasicType() {\n        throw new UnsupportedOperationException(\n                \"The missing type information cannot be used as a type information.\");\n    }\n\n    @Override\n    public boolean isTupleType() {\n        throw new UnsupportedOperationException(\n                \"The missing type information cannot be used as a type information.\");\n    }\n\n    @Override\n    public int getArity() {\n        throw new UnsupportedOperationException(\n                \"The missing type information cannot be used as a type information.\");\n    }\n\n    @Override\n    public Class<InvalidTypesException> getTypeClass() {\n        throw new UnsupportedOperationException(","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/java/typeutils/MissingTypeInfo.java#L42-L78","documentation":"Thrown by MissingTypeInfo.isBasicType(). MissingTypeInfo is a sentinel returned by TypeExtractor when type extraction failed and allowMissing=true; it stores the function name and the original InvalidTypesException. Every informational method on it throws to make the failure unmistakable. isBasicType() is typically called by code that wants to branch on the kind of type information it holds.","triggerScenarios":"TypeExtractor could not infer a type (erasure, missing ReturnTypeInfo), returned MissingTypeInfo, and downstream code calls isBasicType() on it (e.g. during optimizer analysis or operator setup).","commonSituations":"Lambda with unresolvable return type and no .returns() hint; a function whose output type is fully erased; relying on automatic extraction where it cannot succeed.","solutions":["Provide an explicit type hint: .returns(TypeInformation.of(...)) on the offending operator.","Inspect MissingTypeInfo.getTypeException() to find the original extraction failure and fix the root cause.","Use a named class with a concrete generic signature instead of an anonymous/lambda function.","Check MissingTypeInfo via instanceof before calling type methods: if (ti instanceof MissingTypeInfo) handle gracefully."],"exampleFix":"// before\nDataStream<X> out = in.map(lambda); // extraction fails -> MissingTypeInfo -> isBasicType throws\n\n// after\nDataStream<X> out = in.map(lambda).returns(TypeInformation.of(X.class));","handlingStrategy":"type-guard","validationCode":"TypeInformation<?> ti = in.map(fn).getType();\nif (ti instanceof MissingTypeInfo) {\n    throw new IllegalStateException(\"Type extraction failed: \" + ((MissingTypeInfo) ti).getTypeException());\n}","typeGuard":"static boolean isMissing(TypeInformation<?> ti) {\n    return ti instanceof org.apache.flink.api.java.typeutils.MissingTypeInfo;\n}","tryCatchPattern":null,"preventionTips":["Always provide .returns() hints for lambdas with unresolvable return types.","Check for MissingTypeInfo after type-sensitive operations.","Read getTypeException() to diagnose the root cause early."],"tags":["type-extraction","missing-type-info","type-info"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}