danny0405 commented on a change in pull request #10680: 
[FLINK-15125][table-planner-blink] PROCTIME() computed column defined…
URL: https://github.com/apache/flink/pull/10680#discussion_r361355665
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/LogicalWindowAggregateRuleBase.scala
 ##########
 @@ -138,6 +143,86 @@ abstract class 
LogicalWindowAggregateRuleBase(description: String)
     call.transformTo(result)
   }
 
+  /** Trim out the HepRelVertex wrapper and get current relational expression. 
*/
+  private def trimHep(node: RelNode): RelNode = {
+    node match {
+      case hepRelVertex: HepRelVertex =>
+        hepRelVertex.getCurrentRel
+      case _ => node
+    }
+  }
+
+  /**
+   * Rewrite plan with PROCTIME() as window call operand: rewrite the window 
call to
+   * reference the input instead of invoke the PROCTIME() directly, in order 
to simplify the
+   * subsequent rewrite logic.
+   *
+   * For example, plan
+   * <pre>
+   * LogicalProject($f0=[TUMBLE(PROCTIME(), 1000:INTERVAL SECOND)], a=[$0], 
b=[$1])
+   *   +- LogicalTableScan
+   * </pre>
+   *
+   * would be rewritten to
+   * <pre>
+   * LogicalProject($f0=[TUMBLE($2, 1000:INTERVAL SECOND)], a=[$0], b=[$1])
+   * +- LogicalProject(a=[$0], b=[$1], $f2=[PROCTIME()])
+   * +- LogicalTableScan
+   * </pre>
+   */
+  private def rewriteProctimeTumbling(
 
 Review comment:
   Thanks, for this pattern, it also works.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to