A1 报错
A2 原因
lambda表达式编写方式不自动识别返回类型,需要手动跟上returns指定类型。
源码:
/**
* Adds a type information hint about the return type of this operator. This method
* can be used in cases where Flink cannot determine automatically what the produced
* type of a function is. That can be the case if the function uses generic type variables
* in the return type that cannot be inferred from the input type.
*
* <p>In most cases, the methods {@link #returns(Class)} and {@link #returns(TypeHint)}
* are preferable.
*
* @param typeInfo type information as a return type hint
* @return This operator with a give