This is an automated email from the ASF dual-hosted git repository.

sunchao pushed a commit to branch branch-2.3
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/branch-2.3 by this push:
     new 778fd075085 HIVE-25616: [FOLLOWUP] Set auth privileges should respect 
getauth (#3602)
778fd075085 is described below

commit 778fd075085afe1a7794b119f0e9242b22d0063f
Author: Cheng Pan <[email protected]>
AuthorDate: Tue Jul 18 01:22:08 2023 +0800

    HIVE-25616: [FOLLOWUP] Set auth privileges should respect getauth (#3602)
---
 .../java/org/apache/hadoop/hive/metastore/ObjectStore.java | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git 
a/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java 
b/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
index eab348f76f3..d454b955b41 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
@@ -2634,12 +2634,14 @@ public class ObjectStore implements RawStore, 
Configurable {
           max_parts, null, queryWrapper);
       for (Object o : parts) {
         Partition part = convertToPart((MPartition) o);
-        // set auth privileges
-        String partName = 
Warehouse.makePartName(this.convertToFieldSchemas(mtbl
-            .getPartitionKeys()), part.getValues());
-        PrincipalPrivilegeSet partAuth = getPartitionPrivilegeSet(db_name,
-            tbl_name, partName, userName, groupNames);
-        part.setPrivileges(partAuth);
+        if (getauth) {
+          // set auth privileges
+          String partName = 
Warehouse.makePartName(this.convertToFieldSchemas(mtbl
+                  .getPartitionKeys()), part.getValues());
+          PrincipalPrivilegeSet partAuth = getPartitionPrivilegeSet(db_name,
+                  tbl_name, partName, userName, groupNames);
+          part.setPrivileges(partAuth);
+        }
         partitions.add(part);
       }
       success = commitTransaction();

Reply via email to