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

jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new 78b5116cc fix(authorization-ranger):the descr field of ranger table 
x_group is not null (#4975)
78b5116cc is described below

commit 78b5116cc12fc22f6aa19b0c31af68833a91a2ca
Author: yangyuxia <[email protected]>
AuthorDate: Fri Sep 27 17:20:51 2024 +0800

    fix(authorization-ranger):the descr field of ranger table x_group is not 
null (#4975)
    
    ### What changes were proposed in this pull request?
    
    When calling the ranger CREATE_GROUP api, the desc field cannot be null
    
    ### Why are the changes needed?
    
    When calling the ranger CREATE_GROUP api,  ranger response is error.
    
    ### Does this PR introduce _any_ user-facing change?
    
    
    
    ### How was this patch tested?
    
    yes, by hand.
    
    ---------
    
    Co-authored-by: yangyx <[email protected]>
---
 .../gravitino/authorization/ranger/RangerAuthorizationPlugin.java    | 3 ++-
 .../org/apache/gravitino/authorization/ranger/reference/VXGroup.java | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java
 
b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java
index 3b503a3f9..021fca2a9 100644
--- 
a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java
+++ 
b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java
@@ -383,7 +383,8 @@ public abstract class RangerAuthorizationPlugin
 
   @Override
   public Boolean onGroupAdded(Group group) throws RuntimeException {
-    return 
rangerClient.createGroup(VXGroup.builder().withName(group.name()).build());
+    return rangerClient.createGroup(
+        
VXGroup.builder().withName(group.name()).withDescription(group.name()).build());
   }
 
   @Override
diff --git 
a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/reference/VXGroup.java
 
b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/reference/VXGroup.java
index f409cdeb0..3a58f5c95 100644
--- 
a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/reference/VXGroup.java
+++ 
b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/reference/VXGroup.java
@@ -91,6 +91,11 @@ public class VXGroup extends VXDataObject implements 
java.io.Serializable {
       return this;
     }
 
+    public Builder withDescription(String description) {
+      vxGroup.description = description;
+      return this;
+    }
+
     public VXGroup build() {
       return vxGroup;
     }

Reply via email to