You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by pengjianhua <pe...@zte.com.cn> on 2017/09/06 06:32:05 UTC

Re: Review Request 62076: Execute "grant all" command failure in beeline mode when user used Ranger hive plugin.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62076/
-----------------------------------------------------------

(Updated 九月 6, 2017, 6:32 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)
-----------------

Execute "grant all" command failure in beeline mode when user used Ranger hive plugin.


Bugs: RANGER-1766
    https://issues.apache.org/jira/browse/RANGER-1766


Repository: ranger


Description (updated)
-------

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:
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;
        ...  ...
        ...  ...
The hiveObj.getType() is null in above code segment.

The Ranger should support "grant all" command in beeline mode.


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


Re: Review Request 62076: Execute "grant all" command failure in beeline mode when user used Ranger hive plugin.

Posted by Colm O hEigeartaigh <co...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62076/#review184802
-----------------------------------------------------------


Ship it!




Ship It!

- Colm O hEigeartaigh


On Sept. 7, 2017, 1:31 a.m., pengjianhua wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62076/
> -----------------------------------------------------------
> 
> (Updated Sept. 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
> -----
> 
>   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/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> pengjianhua
> 
>


Re: Review Request 62076: Execute "grant all" command failure in beeline mode when user used Ranger hive plugin.

Posted by pengjianhua <pe...@zte.com.cn>.
-----------------------------------------------------------
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


Re: Review Request 62076: Execute "grant all" command failure in beeline mode when user used Ranger hive plugin.

Posted by pengjianhua <pe...@zte.com.cn>.

> On 九月 6, 2017, 4:12 p.m., Colm O hEigeartaigh wrote:
> > Please fix: warning: 2 lines add whitespace errors.
> > 
> > Also, the following two if statements should have a space after "if" and before the opening curly brackets:
> > 
> > if(hiveObj.getType() == null){
> > if(databaseorUrl == null){

Ok. I had fixed it. Thanks.


- pengjianhua


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62076/#review184697
-----------------------------------------------------------


On 九月 7, 2017, 1:31 a.m., pengjianhua wrote:
> 
> -----------------------------------------------------------
> 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
> -----
> 
>   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/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> pengjianhua
> 
>


Re: Review Request 62076: Execute "grant all" command failure in beeline mode when user used Ranger hive plugin.

Posted by Colm O hEigeartaigh <co...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62076/#review184697
-----------------------------------------------------------



Please fix: warning: 2 lines add whitespace errors.

Also, the following two if statements should have a space after "if" and before the opening curly brackets:

if(hiveObj.getType() == null){
if(databaseorUrl == null){

- Colm O hEigeartaigh


On Sept. 6, 2017, 6:34 a.m., pengjianhua wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62076/
> -----------------------------------------------------------
> 
> (Updated Sept. 6, 2017, 6:34 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
> -----
> 
>   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
> 
>


Re: Review Request 62076: Execute "grant all" command failure in beeline mode when user used Ranger hive plugin.

Posted by pengjianhua <pe...@zte.com.cn>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62076/
-----------------------------------------------------------

(Updated 九月 6, 2017, 6:34 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 (updated)
-------

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
-----

  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