You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2013/06/17 18:19:19 UTC

svn commit: r1493832 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/ErrorMsg.java test/org/apache/hadoop/hive/ql/TestErrorMsg.java

Author: hashutosh
Date: Mon Jun 17 16:19:19 2013
New Revision: 1493832

URL: http://svn.apache.org/r1493832
Log:
HIVE-4593 : ErrorMsg has several messages that reuse the same error code (Navis via Ashutosh Chauhan)

Added:
    hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/TestErrorMsg.java
Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java?rev=1493832&r1=1493831&r2=1493832&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java Mon Jun 17 16:19:19 2013
@@ -239,7 +239,7 @@ public enum ErrorMsg {
   JOINNODE_OUTERJOIN_MORETHAN_16(10142, "Single join node containing outer join(s) " +
       "cannot have more than 16 aliases"),
 
-  INVALID_JDO_FILTER_EXPRESSION(10043, "Invalid expression for JDO filter"),
+  INVALID_JDO_FILTER_EXPRESSION(10143, "Invalid expression for JDO filter"),
 
   SHOW_CREATETABLE_INDEX(10144, "SHOW CREATE TABLE does not support tables of type INDEX_TABLE."),
   ALTER_BUCKETNUM_NONBUCKETIZED_TBL(10145, "Table is not bucketized."),
@@ -321,13 +321,6 @@ public enum ErrorMsg {
     "with distincts. Either set hive.new.job.grouping.set.cardinality to a high number " +
     "(higher than the number of rows per input row due to grouping sets in the query), or " +
     "rewrite the query to not use distincts."),
-  TRUNCATE_COLUMN_INDEXED_TABLE(10227, "Can not truncate columns from table with indexes"),
-  TRUNCATE_COLUMN_NOT_RC(10228, "Only RCFileFormat supports column truncation."),
-  TRUNCATE_COLUMN_ARCHIVED(10229, "Column truncation cannot be performed on archived partitions."),
-  TRUNCATE_BUCKETED_COLUMN(10230,
-      "A column on which a partition/table is bucketed cannot be truncated."),
-  TRUNCATE_LIST_BUCKETED_COLUMN(10231,
-      "A column on which a partition/table is list bucketed cannot be truncated."),
 
   OPERATOR_NOT_ALLOWED_WITH_MAPJOIN(10227,
     "Not all clauses are supported with mapjoin hint. Please remove mapjoin hint."),
@@ -350,6 +343,14 @@ public enum ErrorMsg {
   TABLES_INCOMPATIBLE_SCHEMAS(10235, "Tables have incompatible schemas and their partitions " +
             " cannot be exchanged."),
 
+  TRUNCATE_COLUMN_INDEXED_TABLE(10236, "Can not truncate columns from table with indexes"),
+  TRUNCATE_COLUMN_NOT_RC(10237, "Only RCFileFormat supports column truncation."),
+  TRUNCATE_COLUMN_ARCHIVED(10238, "Column truncation cannot be performed on archived partitions."),
+  TRUNCATE_BUCKETED_COLUMN(10239,
+      "A column on which a partition/table is bucketed cannot be truncated."),
+  TRUNCATE_LIST_BUCKETED_COLUMN(10240,
+      "A column on which a partition/table is list bucketed cannot be truncated."),
+
   SCRIPT_INIT_ERROR(20000, "Unable to initialize custom script."),
   SCRIPT_IO_ERROR(20001, "An error occurred while reading or writing to your custom script. "
       + "It may have crashed with an error."),

Added: hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/TestErrorMsg.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/TestErrorMsg.java?rev=1493832&view=auto
==============================================================================
--- hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/TestErrorMsg.java (added)
+++ hive/trunk/ql/src/test/org/apache/hadoop/hive/ql/TestErrorMsg.java Mon Jun 17 16:19:19 2013
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+public class TestErrorMsg extends TestCase {
+
+  public void testUniqueErrorCode() {
+    Set<Integer> numbers = new HashSet<Integer>();
+    for (ErrorMsg err : ErrorMsg.values()) {
+      int code = err.getErrorCode();
+      Assert.assertTrue("duplicated error number " + code, numbers.add(code));
+    }
+  }
+}