-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62076/
-----------------------------------------------------------
(Updated 九月 5, 2017, 7:36 a.m.)
Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O
hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan
Neethiraj, Velmurugan Periasamy, and Qiang Zhang.
Summary (updated)
-----------------
ranger hive-plugin should support "grant all"
Bugs: RANGER-1766
https://issues.apache.org/jira/browse/RANGER-1766
Repository: ranger
Description
-------
when i use beeline to test "grant all", then failed,throw NullPointerException :
0: jdbc:hive2://10.43.183.230:10000> grant select on database default to user
mr ;
No rows affected (0.137 seconds)
0: jdbc:hive2://10.43.183.230:10000> grant all to user mr;
Error: Error while processing statement: FAILED: Execution Error, return code 1
from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.NullPointerException
(state=08S01,code=1)
I saw the code,NullPointerException because hiveObj.getType() is null :
RangerHiveAuthorizer.java
HiveObjectType objType = HiveObjectType.NONE;
switch(hiveObj.getType()) {
case DATABASE:
objType = HiveObjectType.DATABASE;
break;
case PARTITION:
objType = HiveObjectType.PARTITION;
break;
... ...
... ...
I feel here need to modify.
Diffs
-----
hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
1c7a9d08
hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveResource.java
d04d3bfa
Diff: https://reviews.apache.org/r/62076/diff/1/
Testing
-------
Thanks,
pengjianhua