wecharyu commented on code in PR #3218:
URL: https://github.com/apache/hive/pull/3218#discussion_r2426068604


##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/AuthorizationMetaStoreFilterHook.java:
##########
@@ -62,19 +65,24 @@ public List<Table> filterTables(List<Table> tableList) 
throws MetaException {
   private List<Table> getFilteredTableList(List<HivePrivilegeObject> 
hivePrivilegeObjects, List<Table> tableList) {
     List<Table> ret = new ArrayList<>();
     for(HivePrivilegeObject hivePrivilegeObject:hivePrivilegeObjects) {
+      String catName = hivePrivilegeObject.getCatName();
       String dbName  = hivePrivilegeObject.getDbname();
       String tblName = hivePrivilegeObject.getObjectName();
-      Table  table   = getFilteredTable(dbName,tblName,tableList);
+      Table  table   = getFilteredTable(catName, dbName, tblName, tableList);
       if (table != null) {
         ret.add(table);
       }
     }
     return ret;
   }
 
-  private Table getFilteredTable(String dbName, String tblName, List<Table> 
tableList) {
+  private Table getFilteredTable(String catName, String dbName, String 
tblName, List<Table> tableList) {
     Table ret = null;
     for (Table table: tableList) {
+      // do not check catalog name if catName is null
+      if (catName != null && table.getCatName() != null && 
!catName.equals(table.getCatName())) {

Review Comment:
   If the input `tableList` belong to different catalogs, this check would take 
effect. It's similar to the `dbName` check.



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