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.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---