[
https://issues.apache.org/jira/browse/RANGER-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
peng.jianhua updated RANGER-1766:
---------------------------------
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:
{code}
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)
{code}
The error reason is as following:
{code:title=RangerHiveAuthorizer.java|borderStyle=solid}
HiveObjectType objType = HiveObjectType.NONE;
switch(hiveObj.getType()) {
case DATABASE:
objType = HiveObjectType.DATABASE;
break;
case PARTITION:
objType = HiveObjectType.PARTITION;
break;
... ...
... ...
{code}
The hiveObj.getType() is null in above code segment.
The Ranger should support "grant all" command in beeline mode.
was:
when i use beeline to test "grant all", then failed,throw NullPointerException :
{code}
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)
{code}
I saw the code,NullPointerException because hiveObj.getType() is null :
{code:title=RangerHiveAuthorizer.java|borderStyle=solid}
HiveObjectType objType = HiveObjectType.NONE;
switch(hiveObj.getType()) {
case DATABASE:
objType = HiveObjectType.DATABASE;
break;
case PARTITION:
objType = HiveObjectType.PARTITION;
break;
... ...
... ...
{code}
I feel here need to modify.
> Execute "grant all" command failure in beeline mode when user used Ranger
> hive plugin
> -------------------------------------------------------------------------------------
>
> Key: RANGER-1766
> URL: https://issues.apache.org/jira/browse/RANGER-1766
> Project: Ranger
> Issue Type: New Feature
> Components: plugins, Ranger
> Affects Versions: 1.0.0, master
> Reporter: peng.jianhua
> Assignee: peng.jianhua
> Priority: Critical
> Attachments:
> 0001-RANGER-1766-hive-plugin-should-not-throw-NullPointerExcep.patch
>
>
> 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:
> {code}
> 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)
> {code}
> The error reason is as following:
> {code:title=RangerHiveAuthorizer.java|borderStyle=solid}
> HiveObjectType objType = HiveObjectType.NONE;
> switch(hiveObj.getType()) {
> case DATABASE:
> objType = HiveObjectType.DATABASE;
> break;
> case PARTITION:
> objType = HiveObjectType.PARTITION;
> break;
> ... ...
> ... ...
> {code}
> The hiveObj.getType() is null in above code segment.
> The Ranger should support "grant all" command in beeline mode.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)