Quanlong Huang created IMPALA-12397:
---------------------------------------

             Summary: NullPointerException in SHOW ROLES when there are no roles
                 Key: IMPALA-12397
                 URL: https://issues.apache.org/jira/browse/IMPALA-12397
             Project: IMPALA
          Issue Type: Bug
          Components: Security
            Reporter: Quanlong Huang


When there are no roles in Ranger, SHOW ROLES statement hits 
NullPointerException:
{noformat}
Query: show roles
ERROR: InternalException: Error executing SHOW ROLES. Ranger error message: null
{noformat}
The cause is 'roles' here is null:
{code:java}
Set<RangerRole> roles = plugin_.get().getRoles().getRangerRoles();
roleNames = roles.stream().map(RangerRole::getName).collect(Collectors.toSet());
{code}
https://github.com/apache/impala/blob/08501cef2df16991bbd99656c696b978f08aeebe/fe/src/main/java/org/apache/impala/authorization/ranger/RangerImpaladAuthorizationManager.java#L135-L136

To reproduce this, start Impala cluster with Ranger authorization:
{code:bash}
bin/start-impala-cluster.py --impalad_args="--server-name=server1 
--ranger_service_type=hive --ranger_app_id=impala 
--authorization_provider=ranger" --catalogd_args="--server-name=server1 
--ranger_service_type=hive --ranger_app_id=impala 
--authorization_provider=ranger"
{code}
At the begining, there are no roles in Ranger. Run "SHOW ROLES" in Impala to 
reproduce the error.



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

Reply via email to