xuefuz commented on a change in pull request #8785: [FLINK-11480][hive] Create
HiveTableFactory that creates TableSource/…
URL: https://github.com/apache/flink/pull/8785#discussion_r295548810
##########
File path:
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/catalog/DatabaseCalciteSchema.java
##########
@@ -77,6 +84,23 @@ public Table getTable(String tableName) {
!connectorTable.isBatch(),
FlinkStatistic.of(tableSource.getTableStats().orElse(null))))
.orElseThrow(() -> new
TableException("Cannot query a sink only table."));
+ } else if (table instanceof CatalogTable) {
+ Optional<TableFactory> tableFactory =
catalog.getTableFactory();
+ TableSource<Row> tableSource =
tableFactory.map(tf -> ((TableSourceFactory)
tf).createTableSource((CatalogTable) table))
+
.orElse(TableFactoryUtil.findAndCreateTableSource(((CatalogTable)
table).toProperties()));
+
+ if (!(tableSource instanceof
StreamTableSource)) {
Review comment:
The message was from Dawid's change. I didn't add it.
----------------------------------------------------------------
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