talatuyarer commented on code in PR #17873:
URL: https://github.com/apache/iceberg/pull/17873#discussion_r3899761421


##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java:
##########
@@ -331,9 +368,26 @@ public List<String> listTables(String databaseName)
   }
 
   @Override
-  public CatalogTable getTable(ObjectPath tablePath)
+  public CatalogBaseTable getTable(ObjectPath tablePath)
       throws TableNotExistException, CatalogException {
-    Table table = loadIcebergTable(tablePath);
+    Table table;
+    try {
+      table = loadIcebergTable(tablePath);
+    } catch (TableNotExistException e) {
+      // metadata tables ("name$type") can never be views, and without a view 
catalog there is
+      // nothing else to look up
+      if (asViewCatalog == null || tablePath.getObjectName().contains("$")) {

Review Comment:
   Extracted this into a `canBeView()` helper and applied it in `tableExists` 
and `dropTable` as well, so the view catalog is never consulted for 
metadata-table names anywhere. this also fixes tableExists potentially 
returning true for a name that getTable would refuse to load. Kept the check 
rather than dropping it: `$` is Flink's metadata-table syntax, so it should 
never resolve to a view, and skipping the lookup avoids an extra view-catalog 
call on failed metadata-table loads. The alter path is unchanged since 
CatalogManager resolves view identifiers before they reach the catalog.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to