flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] godfreyhe commented on a change in pull request #8499: [FLINK-12575] [table-planner-blink] Introduce planner rules to remove redundant shuffle and collation
Date Fri, 24 May 2019 07:23:15 GMT
godfreyhe commented on a change in pull request #8499: [FLINK-12575] [table-planner-blink]
Introduce planner rules to remove redundant shuffle and collation
URL: https://github.com/apache/flink/pull/8499#discussion_r287242551
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/nodes/physical/batch/BatchExecHashAggregate.scala
 ##########
 @@ -94,6 +99,53 @@ class BatchExecHashAggregate(
         isGlobal = true))
   }
 
+  override def satisfyTraits(requiredTraitSet: RelTraitSet): RelNode = {
+    val requiredDistribution = requiredTraitSet.getTrait(FlinkRelDistributionTraitDef.INSTANCE)
+    val canSatisfy = requiredDistribution.getType match {
+      case SINGLETON => grouping.length == 0
+      case HASH_DISTRIBUTED =>
+        val shuffleKeys = requiredDistribution.getKeys
+        val groupKeysList = ImmutableIntList.of(grouping.indices.toArray: _*)
+        if (requiredDistribution.requireStrict) {
+          shuffleKeys == groupKeysList
 
 Review comment:
   aggregate output rowtype is grouping + aggCalls,  and shuffle keys are from aggregate output
   (can see above example)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message