[ https://issues.apache.org/jira/browse/FLINK-3939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15296251#comment-15296251 ]
ASF GitHub Bot commented on FLINK-3939: --------------------------------------- Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/2014#discussion_r64207510 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/rules/dataSet/DataSetAggregateRule.scala --- @@ -33,20 +33,32 @@ class DataSetAggregateRule "DataSetAggregateRule") { - def convert(rel: RelNode): RelNode = { - val agg: LogicalAggregate = rel.asInstanceOf[LogicalAggregate] - val traitSet: RelTraitSet = rel.getTraitSet.replace(DataSetConvention.INSTANCE) - val convInput: RelNode = RelOptRule.convert(agg.getInput, DataSetConvention.INSTANCE) - - new DataSetAggregate( - rel.getCluster, - traitSet, - convInput, - agg.getNamedAggCalls, - rel.getRowType, - agg.getInput.getRowType, - agg.getGroupSet.toArray) - } + override def matches(call: RelOptRuleCall): Boolean = { --- End diff -- That's a good idea. I won't work for all unsupported operators (inner equi-joins are initially Cartesian products + filters before translation rules merge join and filter), but some operations such as distinct aggregates are not rewritten be rules such that we can throw an exception when they are observed. > Prevent distinct aggregates and grouping sets from being translated > ------------------------------------------------------------------- > > Key: FLINK-3939 > URL: https://issues.apache.org/jira/browse/FLINK-3939 > Project: Flink > Issue Type: Bug > Components: Table API > Reporter: Fabian Hueske > Assignee: Fabian Hueske > Fix For: 1.1.0 > > > Flink's SQL interface is currently not capable of executing distinct > aggregates and grouping sets. > We need to prevent that queries with these operations are translated by > adapting the DataSetAggregateRule. -- This message was sent by Atlassian JIRA (v6.3.4#6332)