|
你好: flink1.10.1 sql在使用hop后并将udaf中merge方法名修改正确后,报如下错:为什么会说找不到匹配的merge方法呢 org.apache.flink.table.planner.codegen.CodeGenException: No matching merge method found for AggregateFunction com.autoai.cns.udaf.PercentileUDAF' 跟踪merge 参数校验源码思路: 1、ImperativeAggCodeGen类的checkNeededMethods方法中if (needMerge) getUserDefinedMethod
2、UserDefinedFunctionUtils类的getUserDefinedMethod方法中,当校验merge第二个参数时(代码详见下面merge)为false,进而导致报错,如何解决?还是说这是flink的一个bug
parameterClassEquals(methodSignature(i), clazz) || parameterDataTypeEquals(internalTypes(i), dataTypes(i))
代码如下:
def merge(accumulator: ListBuffer[Float], its: Iterable[ListBuffer[Float]]): Unit = { its.foreach(i => accumulator ++ i) } | |
|