hadoop-hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zs...@apache.org
Subject svn commit: r732271 - in /hadoop/hive/trunk: ./ common/src/java/org/apache/hadoop/hive/conf/ ql/src/java/org/apache/hadoop/hive/ql/exec/ ql/src/java/org/apache/hadoop/hive/ql/parse/ ql/src/java/org/apache/hadoop/hive/ql/typeinfo/ serde/src/java/org/apa...
Date Wed, 07 Jan 2009 08:33:41 GMT
Author: zshao
Date: Wed Jan  7 00:33:40 2009
New Revision: 732271

URL: http://svn.apache.org/viewvc?rev=732271&view=rev
Log:
HIVE-209. Enabling asserts in tests. (Prasad Chakka via zshao)

Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/build-common.xml
    hadoop/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/typeinfo/StructTypeInfo.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldList.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java
    hadoop/hive/trunk/service/src/test/org/apache/hadoop/hive/service/TestHiveServer.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=732271&r1=732270&r2=732271&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Wed Jan  7 00:33:40 2009
@@ -32,6 +32,8 @@
 
   IMPROVEMENTS
 
+    HIVE-209. Enabling asserts in tests. (Prasad Chakka via zshao)
+
     HIVE-177. Allow specifying custom input and output format in CREATE TABLE.
     (David Phillips via zshao)
 

Modified: hadoop/hive/trunk/build-common.xml
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/build-common.xml?rev=732271&r1=732270&r2=732271&view=diff
==============================================================================
--- hadoop/hive/trunk/build-common.xml (original)
+++ hadoop/hive/trunk/build-common.xml Wed Jan  7 00:33:40 2009
@@ -252,11 +252,14 @@
       <batchtest todir="${test.build.dir}" unless="testcase">
         <fileset dir="${test.build.classes}"
                  includes="**/${test.include}.class"
-                 excludes="**/TestMTQueries.class,**/TestSerDe.class" />
+                 excludes="**/TestSerDe.class" />
       </batchtest>
       <batchtest todir="${test.build.dir}" if="testcase">
         <fileset dir="${test.build.classes}" includes="**/${testcase}.class"/>
       </batchtest>
+      <assertions>
+        <enable />
+      </assertions>
     </junit>
     <fail if="tests.failed">Tests failed!</fail>
   </target>

Modified: hadoop/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java?rev=732271&r1=732270&r2=732271&view=diff
==============================================================================
--- hadoop/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (original)
+++ hadoop/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java Wed Jan  7
00:33:40 2009
@@ -66,7 +66,7 @@
     HADOOPFS("fs.default.name", "file:///"),
     HADOOPMAPFILENAME("map.input.file", null),
     HADOOPJT("mapred.job.tracker", "local"),
-    HADOOPNUMREDUCERS("mapred.reduce.tasks", "1"),
+    HADOOPNUMREDUCERS("mapred.reduce.tasks", 1),
     HADOOPJOBNAME("mapred.job.name", null),
 
     // MetaStore stuff.

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java?rev=732271&r1=732270&r2=732271&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java Wed
Jan  7 00:33:40 2009
@@ -236,6 +236,11 @@
     if (from.equals(java.sql.Date.class) && to.equals(String.class)) {
       return true;
     }
+    // Void can be converted to any type
+    if (from.equals(Void.class)) {
+      return true;
+    }
+    
     // Allow implicit conversion from Byte -> Integer -> Long -> Float -> Double
-> String
     Integer f = numericTypes.get(from);
     Integer t = numericTypes.get(to);

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java?rev=732271&r1=732270&r2=732271&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java Wed
Jan  7 00:33:40 2009
@@ -186,11 +186,12 @@
     if (expressionTree.getToken().getType() == HiveParser.TOK_FUNCTION
         || expressionTree.getToken().getType() == HiveParser.TOK_FUNCTIONDI) {
       assert (expressionTree.getChildCount() != 0);
-      assert (expressionTree.getChild(0).getType() == HiveParser.Identifier);
-      String functionName = unescapeIdentifier(expressionTree.getChild(0).getText());
-      if (FunctionRegistry.getUDAF(functionName) != null) {
-        aggregations.put(expressionTree.toStringTree(), expressionTree);
-        return;
+      if (expressionTree.getChild(0).getType() == HiveParser.Identifier) {
+        String functionName = unescapeIdentifier(expressionTree.getChild(0).getText());
+        if (FunctionRegistry.getUDAF(functionName) != null) {
+          aggregations.put(expressionTree.toStringTree(), expressionTree);
+          return;
+        }
       }
     }
     for (int i = 0; i < expressionTree.getChildCount(); i++) {

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/typeinfo/StructTypeInfo.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/typeinfo/StructTypeInfo.java?rev=732271&r1=732270&r2=732271&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/typeinfo/StructTypeInfo.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/typeinfo/StructTypeInfo.java Wed
Jan  7 00:33:40 2009
@@ -75,7 +75,6 @@
   /** For TypeInfoFactory use only.
    */
   StructTypeInfo(List<String> names, List<TypeInfo> typeInfos) {
-    assert(allStructFieldNames.size() == typeInfos.size());
     allStructFieldNames = new ArrayList<String>();
     allStructFieldNames.addAll(names);
     allStructFieldTypeInfos = new ArrayList<TypeInfo>();

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldList.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldList.java?rev=732271&r1=732270&r2=732271&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldList.java
(original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/DynamicSerDeFieldList.java
Wed Jan  7 00:33:40 2009
@@ -192,8 +192,7 @@
     }
     if(thrift_mode && !stopSeen) {
       // strip off the STOP marker, which may be left if all the fields were in the serialization
-      TField field = iprot.readFieldBegin();
-      assert(field.type == TType.STOP);
+      iprot.readFieldBegin();
     }
     return struct;
   }

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java?rev=732271&r1=732270&r2=732271&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java
(original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java
Wed Jan  7 00:33:40 2009
@@ -42,7 +42,7 @@
   public static boolean isPrimitiveClass(Class<?> c) {
     return ((c == String.class) || (c == Boolean.class) ||
             (c == Character.class) || (c == java.sql.Date.class) || 
-            java.lang.Number.class.isAssignableFrom(c) ||
+            java.lang.Number.class.isAssignableFrom(c) || (c == Void.class) ||
             c.isPrimitive());
   }
   

Modified: hadoop/hive/trunk/service/src/test/org/apache/hadoop/hive/service/TestHiveServer.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/src/test/org/apache/hadoop/hive/service/TestHiveServer.java?rev=732271&r1=732270&r2=732271&view=diff
==============================================================================
--- hadoop/hive/trunk/service/src/test/org/apache/hadoop/hive/service/TestHiveServer.java
(original)
+++ hadoop/hive/trunk/service/src/test/org/apache/hadoop/hive/service/TestHiveServer.java
Wed Jan  7 00:33:40 2009
@@ -187,6 +187,8 @@
     client.execute(sql);
     row = client.fetchOne();
     dsp.setProperty(Constants.SERIALIZATION_DDL, client.getSchema());
+    // Need a new DynamicSerDe instance - re-initialization is not supported.
+    ds = new DynamicSerDe();
     ds.initialize(new Configuration(), dsp);
     o = ds.deserialize(new BytesWritable(row.getBytes()));
   }



Mime
View raw message