hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1489009 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/parse/ java/org/apache/hadoop/hive/ql/plan/ test/queries/clientpositive/ test/results/clientnegative/ test/results/clientpositive/
Date Mon, 03 Jun 2013 14:43:50 GMT
Author: hashutosh
Date: Mon Jun  3 14:43:50 2013
New Revision: 1489009

URL: http://svn.apache.org/r1489009
Log:
HIVE-3846 : alter view rename NPEs with authorization on. (Teddy Choi via Ashutosh Chauhan)

Added:
    hive/trunk/ql/src/test/queries/clientpositive/authorization_8.q
    hive/trunk/ql/src/test/results/clientpositive/authorization_8.q.out
Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java
    hive/trunk/ql/src/test/results/clientnegative/recursive_view.q.out
    hive/trunk/ql/src/test/results/clientpositive/alter_view_rename.q.out

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java?rev=1489009&r1=1489008&r2=1489009&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java Mon
Jun  3 14:43:50 2013
@@ -95,6 +95,7 @@ public final class SemanticAnalyzerFacto
     commandType.put(HiveParser.TOK_DESCDATABASE, HiveOperation.DESCDATABASE);
     commandType.put(HiveParser.TOK_ALTERTABLE_SKEWED, HiveOperation.ALTERTABLE_SKEWED);
     commandType.put(HiveParser.TOK_ANALYZE, HiveOperation.ANALYZE_TABLE);
+    commandType.put(HiveParser.TOK_ALTERVIEW_RENAME, HiveOperation.ALTERVIEW_RENAME);
   }
 
   static {

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java?rev=1489009&r1=1489008&r2=1489009&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java Mon Jun  3 14:43:50
2013
@@ -21,7 +21,6 @@ package org.apache.hadoop.hive.ql.plan;
 import org.apache.hadoop.hive.ql.security.authorization.Privilege;
 
 public enum HiveOperation {
-
   EXPLAIN("EXPLAIN", null, null),
   LOAD("LOAD", null, new Privilege[]{Privilege.ALTER_DATA}),
   EXPORT("EXPORT", new Privilege[]{Privilege.SELECT}, null),
@@ -102,6 +101,7 @@ public enum HiveOperation {
   ALTERTABLE_SKEWED("ALTERTABLE_SKEWED", new Privilege[] {Privilege.ALTER_METADATA}, null),
   ALTERTBLPART_SKEWED_LOCATION("ALTERTBLPART_SKEWED_LOCATION",
       new Privilege[] {Privilege.ALTER_DATA}, null),
+  ALTERVIEW_RENAME("ALTERVIEW_RENAME", new Privilege[] {Privilege.ALTER_METADATA}, null),
   ;
 
   private String operationName;

Added: hive/trunk/ql/src/test/queries/clientpositive/authorization_8.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/authorization_8.q?rev=1489009&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/authorization_8.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/authorization_8.q Mon Jun  3 14:43:50 2013
@@ -0,0 +1,8 @@
+set hive.security.authorization.enabled=true;
+GRANT ALL TO USER hive_test_user;
+CREATE TABLE tbl_j5jbymsx8e (key INT, value STRING) PARTITIONED BY (ds STRING);
+CREATE VIEW view_j5jbymsx8e_1 as SELECT * FROM tbl_j5jbymsx8e;
+DESCRIBE view_j5jbymsx8e_1;
+ALTER VIEW view_j5jbymsx8e_1 RENAME TO view_j5jbymsx8e_2;
+REVOKE ALL FROM USER hive_test_user;
+set hive.security.authorization.enabled=false;

Modified: hive/trunk/ql/src/test/results/clientnegative/recursive_view.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/recursive_view.q.out?rev=1489009&r1=1489008&r2=1489009&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/recursive_view.q.out (original)
+++ hive/trunk/ql/src/test/results/clientnegative/recursive_view.q.out Mon Jun  3 14:43:50
2013
@@ -68,11 +68,11 @@ POSTHOOK: type: DROPVIEW
 POSTHOOK: Input: default@r0
 POSTHOOK: Output: default@r0
 PREHOOK: query: alter view r3 rename to r0
-PREHOOK: type: null
+PREHOOK: type: ALTERVIEW_RENAME
 PREHOOK: Input: default@r3
 PREHOOK: Output: default@r3
 POSTHOOK: query: alter view r3 rename to r0
-POSTHOOK: type: null
+POSTHOOK: type: ALTERVIEW_RENAME
 POSTHOOK: Input: default@r3
 POSTHOOK: Output: default@r0
 POSTHOOK: Output: default@r3

Modified: hive/trunk/ql/src/test/results/clientpositive/alter_view_rename.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/alter_view_rename.q.out?rev=1489009&r1=1489008&r2=1489009&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/alter_view_rename.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/alter_view_rename.q.out Mon Jun  3 14:43:50
2013
@@ -18,11 +18,11 @@ ds                  	string             
 	 	 
 #### A masked pattern was here ####
 PREHOOK: query: ALTER VIEW view1 RENAME TO view2
-PREHOOK: type: null
+PREHOOK: type: ALTERVIEW_RENAME
 PREHOOK: Input: default@view1
 PREHOOK: Output: default@view1
 POSTHOOK: query: ALTER VIEW view1 RENAME TO view2
-POSTHOOK: type: null
+POSTHOOK: type: ALTERVIEW_RENAME
 POSTHOOK: Input: default@view1
 POSTHOOK: Output: default@view1
 POSTHOOK: Output: default@view2

Added: hive/trunk/ql/src/test/results/clientpositive/authorization_8.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/authorization_8.q.out?rev=1489009&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/authorization_8.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/authorization_8.q.out Mon Jun  3 14:43:50
2013
@@ -0,0 +1,34 @@
+PREHOOK: query: GRANT ALL TO USER hive_test_user
+PREHOOK: type: GRANT_PRIVILEGE
+POSTHOOK: query: GRANT ALL TO USER hive_test_user
+POSTHOOK: type: GRANT_PRIVILEGE
+PREHOOK: query: CREATE TABLE tbl_j5jbymsx8e (key INT, value STRING) PARTITIONED BY (ds STRING)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE tbl_j5jbymsx8e (key INT, value STRING) PARTITIONED BY (ds STRING)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@tbl_j5jbymsx8e
+PREHOOK: query: CREATE VIEW view_j5jbymsx8e_1 as SELECT * FROM tbl_j5jbymsx8e
+PREHOOK: type: CREATEVIEW
+POSTHOOK: query: CREATE VIEW view_j5jbymsx8e_1 as SELECT * FROM tbl_j5jbymsx8e
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Output: default@view_j5jbymsx8e_1
+PREHOOK: query: DESCRIBE view_j5jbymsx8e_1
+PREHOOK: type: DESCTABLE
+POSTHOOK: query: DESCRIBE view_j5jbymsx8e_1
+POSTHOOK: type: DESCTABLE
+key                 	int                 	None                
+value               	string              	None                
+ds                  	string              	None                
+PREHOOK: query: ALTER VIEW view_j5jbymsx8e_1 RENAME TO view_j5jbymsx8e_2
+PREHOOK: type: ALTERVIEW_RENAME
+PREHOOK: Input: default@view_j5jbymsx8e_1
+PREHOOK: Output: default@view_j5jbymsx8e_1
+POSTHOOK: query: ALTER VIEW view_j5jbymsx8e_1 RENAME TO view_j5jbymsx8e_2
+POSTHOOK: type: ALTERVIEW_RENAME
+POSTHOOK: Input: default@view_j5jbymsx8e_1
+POSTHOOK: Output: default@view_j5jbymsx8e_1
+POSTHOOK: Output: default@view_j5jbymsx8e_2
+PREHOOK: query: REVOKE ALL FROM USER hive_test_user
+PREHOOK: type: REVOKE_PRIVILEGE
+POSTHOOK: query: REVOKE ALL FROM USER hive_test_user
+POSTHOOK: type: REVOKE_PRIVILEGE



Mime
View raw message