hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From heyongqi...@apache.org
Subject svn commit: r1102108 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/parse/ test/queries/clientnegative/ test/queries/clientpositive/ test/results/clientnegative/ test/results/clientpositive/
Date Wed, 11 May 2011 22:00:41 GMT
Author: heyongqiang
Date: Wed May 11 22:00:40 2011
New Revision: 1102108

URL: http://svn.apache.org/viewvc?rev=1102108&view=rev
Log:
HIVE-1937:DDLSemanticAnalyzer won't take newly set Hive parameters. (Ning Zhang via He Yongqiang)

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

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java?rev=1102108&r1=1102107&r2=1102108&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java Wed May
11 22:00:40 2011
@@ -122,9 +122,9 @@ import org.apache.hadoop.mapred.TextInpu
  */
 public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer {
   private static final Log LOG = LogFactory.getLog("hive.ql.parse.DDLSemanticAnalyzer");
-  public static final Map<Integer, String> TokenToTypeName = new HashMap<Integer,
String>();
+  private static final Map<Integer, String> TokenToTypeName = new HashMap<Integer,
String>();
 
-  public static final Set<String> reservedPartitionValues = new HashSet<String>();
+  private final Set<String> reservedPartitionValues;
   static {
     TokenToTypeName.put(HiveParser.TOK_BOOLEAN, Constants.BOOLEAN_TYPE_NAME);
     TokenToTypeName.put(HiveParser.TOK_TINYINT, Constants.TINYINT_TYPE_NAME);
@@ -168,6 +168,7 @@ public class DDLSemanticAnalyzer extends
 
   public DDLSemanticAnalyzer(HiveConf conf) throws SemanticException {
     super(conf);
+    reservedPartitionValues = new HashSet<String>();
     // Partition can't have this name
     reservedPartitionValues.add(HiveConf.getVar(conf, ConfVars.DEFAULTPARTITIONNAME));
     reservedPartitionValues.add(HiveConf.getVar(conf, ConfVars.DEFAULT_ZOOKEEPER_PARTITION_NAME));
@@ -477,7 +478,6 @@ public class DDLSemanticAnalyzer extends
         revokeDesc), conf));
   }
 
-
   private PrivilegeObjectDesc analyzePrivilegeObject(ASTNode ast,
       HashSet<WriteEntity> outputs)
       throws SemanticException {

Added: hive/trunk/ql/src/test/queries/clientnegative/default_partition_name.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientnegative/default_partition_name.q?rev=1102108&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientnegative/default_partition_name.q (added)
+++ hive/trunk/ql/src/test/queries/clientnegative/default_partition_name.q Wed May 11 22:00:40
2011
@@ -0,0 +1,3 @@
+create table default_partition_name (key int, value string) partitioned by (ds string);
+
+alter table default_partition_name add partition(ds='__HIVE_DEFAULT_PARTITION__');

Added: hive/trunk/ql/src/test/queries/clientpositive/default_partition_name.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/default_partition_name.q?rev=1102108&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/default_partition_name.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/default_partition_name.q Wed May 11 22:00:40
2011
@@ -0,0 +1,7 @@
+create table default_partition_name (key int, value string) partitioned by (ds string);
+
+set hive.exec.default.partition.name='some_other_default_partition_name';
+
+alter table default_partition_name add partition(ds='__HIVE_DEFAULT_PARTITION__');
+
+show partitions default_partition_name;

Added: hive/trunk/ql/src/test/results/clientnegative/default_partition_name.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/default_partition_name.q.out?rev=1102108&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/default_partition_name.q.out (added)
+++ hive/trunk/ql/src/test/results/clientnegative/default_partition_name.q.out Wed May 11
22:00:40 2011
@@ -0,0 +1,6 @@
+PREHOOK: query: create table default_partition_name (key int, value string) partitioned by
(ds string)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: create table default_partition_name (key int, value string) partitioned
by (ds string)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@default_partition_name
+FAILED: Error in semantic analysis: Partition value contains a reserved substring (User value:
__HIVE_DEFAULT_PARTITION__ Reserved substring: __HIVE_DEFAULT_PARTITION__)

Added: hive/trunk/ql/src/test/results/clientpositive/default_partition_name.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/default_partition_name.q.out?rev=1102108&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/default_partition_name.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/default_partition_name.q.out Wed May 11
22:00:40 2011
@@ -0,0 +1,17 @@
+PREHOOK: query: create table default_partition_name (key int, value string) partitioned by
(ds string)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: create table default_partition_name (key int, value string) partitioned
by (ds string)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@default_partition_name
+PREHOOK: query: alter table default_partition_name add partition(ds='__HIVE_DEFAULT_PARTITION__')
+PREHOOK: type: ALTERTABLE_ADDPARTS
+PREHOOK: Input: default@default_partition_name
+POSTHOOK: query: alter table default_partition_name add partition(ds='__HIVE_DEFAULT_PARTITION__')
+POSTHOOK: type: ALTERTABLE_ADDPARTS
+POSTHOOK: Input: default@default_partition_name
+POSTHOOK: Output: default@default_partition_name@ds=__HIVE_DEFAULT_PARTITION__
+PREHOOK: query: show partitions default_partition_name
+PREHOOK: type: SHOWPARTITIONS
+POSTHOOK: query: show partitions default_partition_name
+POSTHOOK: type: SHOWPARTITIONS
+ds=__HIVE_DEFAULT_PARTITION__



Mime
View raw message