[ 
https://issues.apache.org/jira/browse/FLINK-8690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16445682#comment-16445682
 ] 

Fabian Hueske commented on FLINK-8690:
--------------------------------------

Hi [~walterddr] and [~hequn8128],

Thanks for the good discussion!
I think there are two ways to solve this issue:

1. Separate logical optimization rule sets for batch and streaming as you did 
in your branch.
2. Move the {{AggregateExpandDistinctAggregatesRule.JOIN}} rule to the existing 
batch normalization rules, generalize {{FlinkLogicalAggregateConverter}} to 
accept {{DISTINCT}} aggregates, and guard for {{DISTINCT}} aggregations in the 
batch physical translation. 

Both approaches will work, but I think the second approach is a bit cleaner 
because doesn't rely on the cost pruning.

What do you think?


> Update logical rule set to generate FlinkLogicalAggregate explicitly allow 
> distinct agg on DataStream
> -----------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-8690
>                 URL: https://issues.apache.org/jira/browse/FLINK-8690
>             Project: Flink
>          Issue Type: Sub-task
>            Reporter: Rong Rong
>            Assignee: Rong Rong
>            Priority: Major
>
> Currently, *FlinkLogicalAggregate / FlinkLogicalWindowAggregate* does not 
> allow distinct aggregate.
> We are proposing to reuse distinct aggregate codegen work designed for 
> *FlinkLogicalOverAggregate*, to support unbounded distinct aggregation on 
> datastream as well.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to