hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1542180 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java test/queries/clientnegative/illegal_partition_type3.q test/results/clientnegative/illegal_partition_type3.q.out
Date Fri, 15 Nov 2013 06:08:33 GMT
Author: hashutosh
Date: Fri Nov 15 06:08:32 2013
New Revision: 1542180

URL: http://svn.apache.org/r1542180
Log:
HIVE-5685 : partition column type validation doesn't work in some cases (Vikram Dixit via
Ashutosh Chauhan)

Added:
    hive/trunk/ql/src/test/queries/clientnegative/illegal_partition_type3.q
    hive/trunk/ql/src/test/results/clientnegative/illegal_partition_type3.q.out
Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java?rev=1542180&r1=1542179&r2=1542180&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java Fri Nov
15 06:08:32 2013
@@ -1138,8 +1138,8 @@ public abstract class BaseSemanticAnalyz
       Map<ASTNode, ExprNodeDesc> astExprNodeMap)
           throws SemanticException, HiveException {
 
-    if ((astNode == null) || (astNode.getChildren() == null) ||
-        (astNode.getChildren().size() <= 1)) {
+    if ((astNode == null) || (astNode.getChildren() == null) || 
+        (astNode.getChildren().size() == 0)) {
       return;
     }
 

Added: hive/trunk/ql/src/test/queries/clientnegative/illegal_partition_type3.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientnegative/illegal_partition_type3.q?rev=1542180&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientnegative/illegal_partition_type3.q (added)
+++ hive/trunk/ql/src/test/queries/clientnegative/illegal_partition_type3.q Fri Nov 15 06:08:32
2013
@@ -0,0 +1,4 @@
+create table tab1(c int) partitioned by (i int);
+alter table tab1 add partition(i = "some name");
+
+drop table tab1;

Added: hive/trunk/ql/src/test/results/clientnegative/illegal_partition_type3.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/illegal_partition_type3.q.out?rev=1542180&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/illegal_partition_type3.q.out (added)
+++ hive/trunk/ql/src/test/results/clientnegative/illegal_partition_type3.q.out Fri Nov 15
06:08:32 2013
@@ -0,0 +1,6 @@
+PREHOOK: query: create table tab1(c int) partitioned by (i int)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: create table tab1(c int) partitioned by (i int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@tab1
+FAILED: SemanticException [Error 10248]: Cannot add partition column i of type string as
it cannot be converted to type int



Mime
View raw message