[ 
https://issues.apache.org/jira/browse/IMPALA-14884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18078295#comment-18078295
 ] 

Fang-Yu Rao commented on IMPALA-14884:
--------------------------------------

Thanks [~MikaelSmith]!

 
{noformat}
How did you decide on the name SHOW CURRENT GROUPS?
{noformat}
I chose to use "SHOW CURRENT GROUPS" because Impala already supports "SHOW 
CURRENT ROLES" that displays roles assigned to the current user as described at 
https://github.com/apache/impala/blob/master/docs/topics/impala_show.xml#L386C7-L392C11.

{noformat}
Are there other DBs using that syntax?
{noformat}
It looks like no major relational database management system (RDBMS) (like 
MySQL, PostgreSQL, or SQL Server) uses the exact command of "SHOW CURRENT 
GROUPS".

{noformat}
Are there other variations that would replace "CURRENT"?
{noformat}
Maybe we could use something like "EFFECTIVE" if we don't really like to use 
"CURRENT"?


> 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
>            Priority: Major
>
> 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 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)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to