wuchong commented on a change in pull request #10316: 
[FLINK-14624][table-blink] Support computed column as rowtime attribute
URL: https://github.com/apache/flink/pull/10316#discussion_r353731812
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/schema/CatalogSourceTable.scala
 ##########
 @@ -76,21 +74,25 @@ class CatalogSourceTable[T](
       tableSource,
       schemaTable.isStreamingMode,
       catalogTable)
-    if (columnExprs.isEmpty) {
-      LogicalTableScan.create(cluster, tableSourceTable)
-    } else {
-      // Get row type of physical fields.
-      val physicalFields = getRowType
-        .getFieldList
-        .filter(f => !columnExprs.contains(f.getName))
-        .map(f => f.getIndex)
-        .toArray
-      // Copy this table with physical scan row type.
-      val newRelTable = tableSourceTable.copy(tableSource, physicalFields)
-      val scan = LogicalTableScan.create(cluster, newRelTable)
-      val toRelContext = context.asInstanceOf[FlinkToRelContext]
-      val relBuilder = toRelContext.createRelBuilder()
-      val fieldNames = rowType.getFieldNames.asScala
+
+    // 1. push table scan
+
+    // Get row type of physical fields.
+    val physicalFields = getRowType
+      .getFieldList
+      .filter(f => !columnExprs.contains(f.getName))
+      .map(f => f.getIndex)
+      .toArray
+    // Copy this table with physical scan row type.
+    val newRelTable = tableSourceTable.copy(tableSource, physicalFields)
 
 Review comment:
   I would like to avoid duplicating the logic of projecting RelDataType which 
is error-prone.

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