KurtYoung 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_r353603566
##########
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:
You can new `TableSourceTable` here, no need to first new one and copy here.
----------------------------------------------------------------
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