henrib commented on code in PR #6936:
URL: https://github.com/apache/hive/pull/6936#discussion_r4445916703


##########
iceberg/iceberg-rest-catalog-client/src/main/java/org/apache/iceberg/hive/rest/catalog/client/HiveRESTCatalogClient.java:
##########
@@ -207,11 +210,20 @@ public Table getTable(GetTableRequest tableRequest) 
throws TException {
       return MetastoreUtil.toHiveTable(icebergTable, conf);
     } catch (NoSuchTableException tableMissing) {
       if (restCatalog instanceof ViewCatalog viewCatalog) {
-        if (!viewCatalog.viewExists(id)) {
+        View view;
+        try {
+          view = viewCatalog.loadView(id);
+        } catch (NoSuchViewException viewMissing) {
           throw new NoSuchObjectException();
         }
-        return MetastoreUtil.buildMinimalHMSView(
+        Table hmsView = MetastoreUtil.buildMinimalHMSView(
             tableRequest.getCatName(), tableRequest.getDbName(), 
tableRequest.getTblName());
+        // Carry the server-reported Authorized state as the HMS view 
parameter; when the server reports none, the
+        // view is treated as a deferred-authorization view.
+        if 
(!"true".equalsIgnoreCase(view.properties().get(HiveCatalog.VIEW_AUTHORIZED_PROPERTY)))
 {
+          hmsView.getParameters().put(HiveCatalog.HMS_VIEW_AUTHORIZED, 
"false");

Review Comment:
   Addressed in ef55f3329f: the Authorized state is now taken from the same 
view load as the SQL; test added.



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