Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/3471#discussion_r104613673 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/rules/dataSet/DataSetAggregateRule.scala --- @@ -42,6 +41,14 @@ class DataSetAggregateRule return false } + // distinct is translated into dedicated operator + if (agg.getAggCallList.isEmpty && + agg.getGroupCount == agg.getRowType.getFieldCount && --- End diff -- During testing I observed a case where a projection wasn't pushed down. Without this check, the grouping would happen on a subset of fields and only those would be emitted. It is not possible to change the input and output types of a ReduceFunction (which is used to implement Distinct in a hash-combinable way), I check that the input and output types are identical.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---