我正在尝试按照此处的步骤创建基本的 Flink Aggregate UDF。我已经添加了依赖项()并实现了
public class MyAggregate extends AggregateFunction<Long, TestAgg> {..}
我已经实现了强制方法以及其他一些方法:accumulate, merge, etc
. 所有这些构建都没有错误。现在根据文档,我应该可以将其注册为
StreamExecutionEnvironment sEnv = StreamExecutionEnvironment.getExecutionEnvironment();
StreamTableEnvironment sTableEnv = StreamTableEnvironment.getTableEnvironment(sEnv);
sTableEnv.registerFunction("MyMin", new MyAggregate());
但是,registerFucntion
似乎ScalarFunction
只需要一个作为输入。我收到不兼容的类型错误:The method registerFunction(String, ScalarFunction) in the type TableEnvironment is not applicable for the arguments (String, MyAggregate)
任何帮助都会很棒。