godfreyhe commented on a change in pull request #14916:
URL: https://github.com/apache/flink/pull/14916#discussion_r705020306



##########
File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/optimize/program/FlinkOptimizeContext.scala
##########
@@ -30,6 +30,12 @@ trait FlinkOptimizeContext extends FlinkContext {
     */
   def getRexBuilder: RexBuilder
 
+  /**
+   * Gets the [[FlinkRelBuilder]] defined in 
[[org.apache.flink.table.api.TableEnvironment]]
+   * @return
+   */
+  def getFlinkRelBuilder: FlinkRelBuilder

Review comment:
       we can just replace `def getRexBuilder: RexBuilder` with `def 
getFlinkRelBuilder: FlinkRelBuilder`, because we can get RexBuilder via 
FlinkRelBuilder and `getRexBuilder` method is used only in one place.

##########
File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/LogicalCorrelateToJoinFromTemporalTableFunctionRule.scala
##########
@@ -97,7 +98,9 @@ class LogicalCorrelateToJoinFromTemporalTableFunctionRule
           .getUnderlyingHistoryTable
         val rexBuilder = cluster.getRexBuilder
 
-        val relBuilder = FlinkRelBuilder.of(cluster, getRelOptSchema(leftNode))
+        val relBuilder = FlinkRelMdNonCumulativeCost.THREAD_PLANNER.get()

Review comment:
       use `ShortcutUtils.unwrapContext(cluster)` instead




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to