hi, 你看到的 select count(distinct a, b) from mytable 单元测试能通过,应该是只测试 logical plan,当前在生成 physical plan的时候,显示的禁用了多个字段
Bests, Godfrey apache22 <[email protected]> 于2020年2月26日周三 下午6:56写道: > 我的经验: > count(distinct 只支持单字段) , distinct a,b 是可以的 > 有一个解决方式:count(distinct concat(a,b)) > > > | | > apache22 > | > | > [email protected] > | > 签名由网易邮箱大师定制 > 在2020年2月26日 18:21,小旋锋<[email protected]> 写道: > 大家好: > 我在flink官方文档上看到内置聚合函数count的函数头是这样的 > count([all] Expression | distinct Expression1 > [, Expression2]) > 所以它应该可以对多个属性进行distinct去重,而且我在源码的单元测试里也看到有几个用例 > select count(distinct a, b) from mytable,并且是可以运行通过的 > 但是我自己写sql却运行不起来,报异常 codegenexpression. > No matching accumulate methods for Aggregation function. > ......CountAggFunction with Parameters (Java.lang.String, java.lang.Long) > Flink1.8和1.9都无法运行,请问这是什么情况呢?
