flink1.10.1 merge参数不支持scala的迭代器吗?这算是flink的bug吗

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

flink1.10.1 merge参数不支持scala的迭代器吗?这算是flink的bug吗

bigdata
你好:
org.apache.flink.table.planner.codegen.CodeGenException: No matching merge method found for AggregateFunction com.autoai.cns.udaf.PercentileUDAF'问题原因已找到:merge我是用的scala的迭代器,经过和官网对照后改成java的迭代器就可以了。
    我想补充下,flink1.10.1 merge参数不支持scala的迭代器吗?这算是flink的bug吗
修改后代码如下:
def merge(accumulator: ListBuffer[Float], its: java.lang.Iterable[ListBuffer[Float]]): Unit = {
//    its.forEach(i => accumulator ++ i)
    val iter = its.iterator()
    while (iter.hasNext) {
      val a = iter.next()
      accumulator ++ a
    }
  }