You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/06/05 17:24:22 UTC

[GitHub] [flink] bowenli86 commented on a change in pull request #8634: [FLINK-12257][table-api][table-planner] Instantiate TableSource from CatalogTable

bowenli86 commented on a change in pull request #8634: [FLINK-12257][table-api][table-planner] Instantiate TableSource from CatalogTable
URL: https://github.com/apache/flink/pull/8634#discussion_r290848712
 
 

 ##########
 File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/catalog/DatabaseCalciteSchema.java
 ##########
 @@ -77,6 +81,21 @@ public Table getTable(String tableName) {
 						!connectorTable.isBatch(),
 						FlinkStatistic.UNKNOWN()))
 					.orElseThrow(() -> new TableException("Cannot query a sink only table."));
+			} else if (table instanceof CatalogTable) {
+				Map<String, String> properties = ((CatalogTable) table).toProperties();
+				TableSource<?> tableSource = TableFactoryUtil.findAndCreateTableSource(properties);
+				if (!(tableSource instanceof StreamTableSource)) {
+					throw new TableException("Catalog tables support only StreamTableSource and BoundedTableSource");
 
 Review comment:
   I didn't find `BoundedTableSource` in code base

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services