Fang-Yu Rao created IMPALA-14884:
------------------------------------

             Summary: Consider supporting SHOW CURRENT GROUPS statement
                 Key: IMPALA-14884
                 URL: https://issues.apache.org/jira/browse/IMPALA-14884
             Project: IMPALA
          Issue Type: Task
            Reporter: Fang-Yu Rao
            Assignee: Fang-Yu Rao


Impala uses [RangerAuthorizationChecker#getUserGroups(User 
user)|https://github.com/apache/impala/blob/764e225292e07a8de11ed924dbdde4c9221b5ff8/fe/src/main/java/org/apache/impala/authorization/ranger/RangerAuthorizationChecker.java#L567-L578]
 to resolve the groups of a given user in the production environment during 
authorization.
{code:java}
  public Set<String> getUserGroups(User user) throws InternalException {
    Preconditions.checkNotNull(user);
    UserGroupInformation ugi;
    if (RuntimeEnv.INSTANCE.isTestEnv() ||
        BackendConfig.INSTANCE.useCustomizedUserGroupsMapperForRanger()) {
      ugi = UserGroupInformation.createUserForTesting(user.getShortName(),
          new String[]{user.getShortName()});
    } else {
      ugi = UserGroupInformation.createRemoteUser(user.getShortName());
    }
    return new HashSet<>(ugi.getGroups());
  }
{code}
It would be very helpful if Impala supports the {{SHOW CURRENT GROUPS}} 
statement that lists the groups associated with the current/effective user, 
especially when it's not easy to retrieve such information in an environment 
where the related command line tools are not installed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to