flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] KurtYoung commented on a change in pull request #8051: [FLINK-12018] [table-planner-blink] Add support for generating optimized logical plan for Sort and Rank
Date Mon, 01 Apr 2019 04:27:45 GMT
KurtYoung commented on a change in pull request #8051:  [FLINK-12018] [table-planner-blink]
Add support for generating optimized logical plan for Sort and Rank
URL: https://github.com/apache/flink/pull/8051#discussion_r270713589
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/nodes/calcite/Rank.scala
 ##########
 @@ -91,10 +89,13 @@ abstract class Rank(
   }
 
   override def deriveRowType(): RelDataType = {
+    if (!outputRankNumber) {
+      return input.getRowType
+    }
     val typeFactory = cluster.getRexBuilder.getTypeFactory
     val typeBuilder = typeFactory.builder()
     input.getRowType.getFieldList.foreach(typeBuilder.add)
-    // rank function column is always the last column, and its type is BIGINT NOT NULL
+    // rank number column is always the last column, and its type is BIGINT NOT NULL
     val allFieldNames = new util.HashSet[String]()
     allFieldNames.addAll(input.getRowType.getFieldNames)
     val rankFieldName = FlinkRelOptUtil.buildUniqueFieldName(allFieldNames, "rk")
 
 Review comment:
   Not sure about this, it looks like a BLOCKER to me. Without this, i don't think user can
simply write a correct query to meet this optimization.  

----------------------------------------------------------------
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