luoyuxia commented on code in PR #22166:
URL: https://github.com/apache/flink/pull/22166#discussion_r1147336843


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/delegation/PlannerBase.scala:
##########
@@ -169,17 +171,53 @@ abstract class PlannerBase(
   override def getParser: Parser = {
     if (parser == null || getTableConfig.getSqlDialect != currentDialect) {
       dialectFactory = getDialectFactory
-      parser =
-        dialectFactory.create(new DefaultParserContext(catalogManager, 
plannerContext, executor))
+      parser = dialectFactory.create(
+        new DefaultCalciteContext(catalogManager, getOperationTreeBuilder, 
plannerContext))
     }
     parser
   }
 
+  private def getOperationTreeBuilder: OperationTreeBuilder = {
+    OperationTreeBuilderImpl.create(
+      tableConfig,
+      classLoader,
+      functionCatalog.asLookup(f => getParser.parseIdentifier(f)),
+      catalogManager.getDataTypeFactory,
+      (path: String) => getTableReferenceExpression(path),
+      (s: String, inputRowType: RowType, outputType) =>
+        getParser.parseSqlExpression(s, inputRowType, outputType),
+      isStreamingMode
+    )
+  }

Review Comment:
   I do agree. We can add it in the future when we do need it. That does make 
everything simple.
   
   Btw, the reason that `OperationTreeBuilder` miss join is the `JoinType` is 
not marked as `PublicEvolving `, so we can't expose it in 
`OperationTreeBuilder`.



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