-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62076/
-----------------------------------------------------------
(Updated 九月 7, 2017, 1:31 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.
Bugs: RANGER-1766
https://issues.apache.org/jira/browse/RANGER-1766
Repository: ranger
Description
-------
Execute "grant all" command failure in beeline mode when user used Ranger hive
plugin. The original function of the hive was effected after used Ranger hive
plugin. The error is as following:
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)
The error reason is as following:
RangerHiveAuthorizer.java:
HiveObjectType objType = HiveObjectType.NONE;
switch(hiveObj.getType()) {
case DATABASE:
objType = HiveObjectType.DATABASE;
break;
case PARTITION:
objType = HiveObjectType.PARTITION;
break;
... ...
... ...
The hiveObj.getType() is null in above code segment.
The Ranger should support "grant all" command in beeline mode.
Diffs (updated)
-----
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/2/
Changes: https://reviews.apache.org/r/62076/diff/1-2/
Testing
-------
Thanks,
pengjianhua