difin commented on code in PR #6449:
URL: https://github.com/apache/hive/pull/6449#discussion_r3349620029


##########
iceberg/iceberg-catalog/src/main/java/org/apache/iceberg/hive/client/HiveRESTCatalogClient.java:
##########
@@ -178,38 +205,86 @@ public Database getDatabase(String catName, String 
dbName) throws NoSuchObjectEx
   @Override
   public Table getTable(GetTableRequest tableRequest) throws TException {
     validateCurrentCatalog(tableRequest.getCatName());
-    org.apache.iceberg.Table icebergTable;
+    TableIdentifier id =
+        TableIdentifier.of(tableRequest.getDbName(), 
tableRequest.getTblName());
     try {
-      icebergTable = 
restCatalog.loadTable(TableIdentifier.of(tableRequest.getDbName(),
-          tableRequest.getTblName()));
-    } catch (NoSuchTableException exception) {
+      org.apache.iceberg.Table icebergTable = restCatalog.loadTable(id);
+      return MetastoreUtil.toHiveTable(icebergTable, conf);
+    } catch (NoSuchTableException tableMissing) {
+      if (restCatalog instanceof ViewCatalog viewCatalog) {

Review Comment:
   Same as above, we can't decide where to call using just an `instanceof`.



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