Github user vasia commented on a diff in the pull request:
https://github.com/apache/flink/pull/1600#discussion_r52192508
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/nodes/logical/FlinkAggregate.scala
---
@@ -58,19 +58,23 @@ class FlinkAggregate(
)
}
- override def computeSelfCost (planner: RelOptPlanner): RelOptCost = {
-
- val origCosts = super.computeSelfCost(planner)
- val deltaCost = planner.getCostFactory.makeHugeCost()
-
- // only prefer aggregations with transformed Avg
- aggCalls.toList.foldLeft[RelOptCost](origCosts){
- (c: RelOptCost, a: AggregateCall) =>
- if (a.getAggregation.isInstanceOf[SqlAvgAggFunction]) {
- c.plus(deltaCost)
- } else {
- c
- }
- }
- }
+//
+// DO NOT ASSIGN HUGE COSTS TO PLANS WITH AVG AGGREGATIONS
+// ONLY NECESSARY IF AggregateReduceFunctionsRule IS ENABLED.
+//
+// override def computeSelfCost (planner: RelOptPlanner): RelOptCost = {
+//
+// val origCosts = super.computeSelfCost(planner)
+// val deltaCost = planner.getCostFactory.makeHugeCost()
+//
+// // only prefer aggregations with transformed Avg
+// aggCalls.toList.foldLeft[RelOptCost](origCosts){
+// (c: RelOptCost, a: AggregateCall) =>
+// if (a.getAggregation.isInstanceOf[SqlAvgAggFunction]) {
+// c.plus(deltaCost)
+// } else {
+// c
+// }
+// }
+// }
--- End diff --
Yes, we decided to disable `AggregateReduceFunctionsRule` temporarily, thus
the note on top.
I could remove it completely if you think it'd be better.
---
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.
---