danny0405 commented on a change in pull request #8859: 
[FLINK-12905][table-planner] Enable querying CatalogViews in legacy planner
URL: https://github.com/apache/flink/pull/8859#discussion_r350512524
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/catalog/DatabaseCalciteSchema.java
 ##########
 @@ -68,25 +68,28 @@ public Table getTable(String tableName) {
                return catalogManager.getTable(identifier)
                        .map(result -> {
                                CatalogBaseTable table = result.getTable();
-                               Catalog catalog = 
catalogManager.getCatalog(catalogName).get();
-                               FlinkStatistic statistic = 
getStatistic(result.isTemporary(),
-                                       catalog, table, identifier);
+                               FlinkStatistic statistic = 
getStatistic(result.isTemporary(), table, identifier);
                                return new CatalogSchemaTable(identifier,
                                        table,
                                        statistic,
-                                       catalog.getTableFactory().orElse(null),
+                                       catalogManager.getCatalog(catalogName)
+                                               
.flatMap(Catalog::getTableFactory)
 
 Review comment:
   Did you mean a temporal object could exist without a catalog ? For example, 
the view ?

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