twalthr commented on a change in pull request #8549:
[FLINK-12604][table-api][table-planner] Register TableSource/Sink as
CatalogTables
URL: https://github.com/apache/flink/pull/8549#discussion_r289804668
##########
File path:
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/catalog/DatabaseCalciteSchema.java
##########
@@ -65,10 +67,16 @@ public Table getTable(String tableName) {
CatalogBaseTable table = catalog.getTable(tablePath);
- if (table instanceof CalciteCatalogTable) {
- return ((CalciteCatalogTable) table).getTable();
- } else if (table instanceof TableOperationCatalogView) {
+ if (table instanceof TableOperationCatalogView) {
return
TableOperationCatalogViewTable.createCalciteTable(((TableOperationCatalogView)
table));
+ } else if (table instanceof ConnectorCatalogTable) {
+ ConnectorCatalogTable<?, ?> connectorTable =
(ConnectorCatalogTable<?, ?>) table;
+ return connectorTable.getTableSource()
+ .map(tableSource -> new
TableSourceTable<>(
+ tableSource,
+ !connectorTable.isBatch(),
+ FlinkStatistic.UNKNOWN()))
+ .orElseThrow(() -> new
TableException("Querying sink only table unsupported."));
Review comment:
rephrase: "Catalog table does only support sink operations."?
----------------------------------------------------------------
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