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 #8051: [FLINK-12018] [table-planner-blink] Add support for generating optimized logical plan for Sort and Rank
Date Mon, 01 Apr 2019 02:16:24 GMT
godfreyhe 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_r270701308
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/util/FlinkRelOptUtil.scala
 ##########
 @@ -248,4 +251,262 @@ object FlinkRelOptUtil {
     }
   }
 
+  private[this] case class LimitPredicate(rankOnLeftSide: Boolean, pred: RexCall)
+
+  private[this] sealed trait Boundary
+
+  private[this] case class LowerBoundary(lower: Long) extends Boundary
+
+  private[this] case class UpperBoundary(upper: Long) extends Boundary
+
+  private[this] case class BothBoundary(lower: Long, upper: Long) extends Boundary
+
+  private[this] case class InputRefBoundary(inputFieldIndex: Int) extends Boundary
+
+  private[this] sealed trait BoundDefine
+
+  private[this] object Lower extends BoundDefine // defined lower bound
+  private[this] object Upper extends BoundDefine // defined upper bound
+  private[this] object Both extends BoundDefine // defined lower and uppper bound
+
+  /**
+    * Extracts the TopN offset and fetch bounds from a predicate.
+    *
+    * @param  predicate           predicate
+    * @param  rankFieldIndex      the index of rank field
+    * @param  rexBuilder          RexBuilder
+    * @param  config              TableConfig
+    * @return A Tuple2 of extracted rank range and remaining predicates.
+    */
+  def extractRankRange(
 
 Review comment:
   OK

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