apache/flink · error · UnsupportedOperationException

The missing type information cannot be used as a type inform

Error message

The missing type information cannot be used as a type information.

What it means

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.

Source

Thrown at flink-core/src/main/java/org/apache/flink/api/java/typeutils/MissingTypeInfo.java:60

        this.functionName = functionName;
        this.typeException = typeException;
    }

    // --------------------------------------------------------------------------------------------

    public String getFunctionName() {
        return functionName;
    }

    public InvalidTypesException getTypeException() {
        return typeException;
    }

    // --------------------------------------------------------------------------------------------

    @Override
    public boolean isBasicType() {
        throw new UnsupportedOperationException(
                "The missing type information cannot be used as a type information.");
    }

    @Override
    public boolean isTupleType() {
        throw new UnsupportedOperationException(
                "The missing type information cannot be used as a type information.");
    }

    @Override
    public int getArity() {
        throw new UnsupportedOperationException(
                "The missing type information cannot be used as a type information.");
    }

    @Override
    public Class<InvalidTypesException> getTypeClass() {
        throw new UnsupportedOperationException(

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Provide an explicit type hint: .returns(TypeInformation.of(...)) on the offending operator.
  2. Inspect MissingTypeInfo.getTypeException() to find the original extraction failure and fix the root cause.
  3. Use a named class with a concrete generic signature instead of an anonymous/lambda function.
  4. Check MissingTypeInfo via instanceof before calling type methods: if (ti instanceof MissingTypeInfo) handle gracefully.

Example fix

// before
DataStream<X> out = in.map(lambda); // extraction fails -> MissingTypeInfo -> isBasicType throws

// after
DataStream<X> out = in.map(lambda).returns(TypeInformation.of(X.class));
Defensive patterns

Strategy: type-guard

Validate before calling

TypeInformation<?> ti = in.map(fn).getType();
if (ti instanceof MissingTypeInfo) {
    throw new IllegalStateException("Type extraction failed: " + ((MissingTypeInfo) ti).getTypeException());
}

Type guard

static boolean isMissing(TypeInformation<?> ti) {
    return ti instanceof org.apache.flink.api.java.typeutils.MissingTypeInfo;
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/e3be073efb4ac23e. Report an issue: GitHub.