自定义 UDAF 不工作(Ksql:Confluent)

Custom UDAF not working ( Ksql: Confluent)

我在 Ksql 中创建自定义 UDAF 时遇到问题。用例是在翻滚 window 中查找列的 "first" 和 "last" 值。没有这样的内置 UDAF (https://docs.confluent.io/current/ksql/docs/syntax-reference.html#aggregate-functions),所以我正在尝试创建自定义 UDAF。

我根据此文档执行了以下步骤 https://www.confluent.io/blog/write-user-defined-function-udf-ksql/

我。创建了 UDAF & AggregateFunctionFactory 并在 FunctionRegistry 中注册如下:

addAggregateFunctionFactory(new MyAggFunctionFactory());

ii.Build ksql-engine jar 并在以下路径 $CONFLUENT_HOME/share/java/ksql 中替换了 confluent 包中的相同内容。

iii.Restarted ksql 服务器

不过好像没有注册这个功能。有什么建议吗?

融合版本:4.1.0

注意:我尝试创建简单的 UDF。效果很好。问题出在 UDAF

问题是我将函数命名为 'First',这似乎是某个关键字。改了函数名,成功了