ji chen has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/20439


Change subject: IMPALA-12397: NullPointerException in SHOW ROLES when there are 
no roles
......................................................................

IMPALA-12397: NullPointerException in SHOW ROLES when there are no roles

When there are no roles in Ranger, SHOW ROLES statement hits
NullPointerException. The root cause is following statement
plugin_.get().getRoles().getRangerRoles(), will return null
for latest version of ranger plugin, the issue is not observed
in previous version of ranger plugin.
This patch will catch the NullPointerException if the exception
occurs, it will return a reference to empty hashset.
the corresponding unit test and end to end test are added to cover
all SHOW ROLE statement cases.

Testing:
- Pass unit tests.
- Pass e2e tests.
- Pass core tests with ranger enabled

Change-Id: Id80fc2c9152a09194718da1b4266c5f804f0971f
---
M 
fe/src/main/java/org/apache/impala/authorization/ranger/RangerImpaladAuthorizationManager.java
A 
fe/src/test/java/org/apache/impala/authorization/ranger/RangerImpaladAuthorizationManagerTest.java
M tests/authorization/test_ranger.py
3 files changed, 111 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/39/20439/1
--
To view, visit http://gerrit.cloudera.org:8080/20439
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id80fc2c9152a09194718da1b4266c5f804f0971f
Gerrit-Change-Number: 20439
Gerrit-PatchSet: 1
Gerrit-Owner: ji chen <jichen0...@163.com>

Reply via email to