flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhueske <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-3226] Translate logical aggregations to...
Date Tue, 09 Feb 2016 13:06:30 GMT
Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1600#discussion_r52304432
  
    --- 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 --
    
    It's fine to drop the code. We can improve the aggregations later.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message