godfreyhe commented on a change in pull request #8707: [FLINK-12815] 
[table-planner-blink] Supports CatalogManager in blink planner
URL: https://github.com/apache/flink/pull/8707#discussion_r294278719
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/util/RelShuttles.scala
 ##########
 @@ -97,14 +97,15 @@ class ExpandTableScanShuttle extends RelShuttleImpl {
   }
 
   /**
-    * Converts [[LogicalTableScan]] the result [[RelNode]] tree by calling 
[[RelTable]]#toRel
+    * Converts [[LogicalTableScan]] the result [[RelNode]] tree
+    * by calling [[QueryOperationCatalogViewTable]]#toRel
     */
   override def visit(scan: TableScan): RelNode = {
     scan match {
       case tableScan: LogicalTableScan =>
-        val relTable = tableScan.getTable.unwrap(classOf[RelTable])
-        if (relTable != null) {
-          val rel = 
relTable.toRel(RelOptUtil.getContext(tableScan.getCluster), tableScan.getTable)
+        val viewTable = 
tableScan.getTable.unwrap(classOf[QueryOperationCatalogViewTable])
 
 Review comment:
   yes, we meet this problem in blink code. and we put the `FlinkPlannerImpl` 
instance into the calcite planner context, and get it from context to parser a 
string query in `CatalogTableToTableSourceRule`. it's a little hack! We will 
try to find a clean way to resolve it  in next pr.

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