You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Fanbin Bu <fa...@coinbase.com> on 2020/02/10 19:35:52 UTC

merge implementation in count distinct

Hi,

For the following implementation of merge,
https://github.com/apache/flink/blob/0ab1549f52f1f544e8492757c6b0d562bf50a061/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/runtime/utils/JavaUserDefinedAggFunctions.java#L224

what if acc has the some keys in mergeAcc? the merged count would not be
accurate then. I think the count should be incremented by one in
https://github.com/apache/flink/blob/0ab1549f52f1f544e8492757c6b0d562bf50a061/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/runtime/utils/JavaUserDefinedAggFunctions.java#L236


Thanks,
Fanbin

Re: merge implementation in count distinct

Posted by Jark Wu <im...@gmail.com>.
Hi Fanbin,

Thanks for reporting this. I think you are right, the implementation is not
correct. I have created a JIRA issue [1] to fix this.
Btw, the CountDistinctWithMerge in blink planner is implemented correctly
[2].

Best,
Jark

[1]: https://issues.apache.org/jira/browse/FLINK-15979
[2]:
https://github.com/apache/flink/blob/master/flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/plan/utils/JavaUserDefinedAggFunctions.java#L369


On Tue, 11 Feb 2020 at 03:36, Fanbin Bu <fa...@coinbase.com> wrote:

> Hi,
>
> For the following implementation of merge,
> https://github.com/apache/flink/blob/0ab1549f52f1f544e8492757c6b0d562bf50a061/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/runtime/utils/JavaUserDefinedAggFunctions.java#L224
>
> what if acc has the some keys in mergeAcc? the merged count would not be
> accurate then. I think the count should be incremented by one in
> https://github.com/apache/flink/blob/0ab1549f52f1f544e8492757c6b0d562bf50a061/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/runtime/utils/JavaUserDefinedAggFunctions.java#L236
>
>
> Thanks,
> Fanbin
>
>
>