You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by zs...@apache.org on 2009/01/08 01:46:06 UTC

svn commit: r732571 - in /hadoop/hive/trunk: ./ data/files/ ql/src/java/org/apache/hadoop/hive/ql/exec/ ql/src/test/results/clientpositive/ serde/src/test/org/apache/hadoop/hive/serde2/thrift_test/

Author: zshao
Date: Wed Jan  7 16:46:06 2009
New Revision: 732571

URL: http://svn.apache.org/viewvc?rev=732571&view=rev
Log:
HIVE-161. Fixed xpath x.y when x is a null list. (zshao)

Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/data/files/complex.seq
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeFieldEvaluator.java
    hadoop/hive/trunk/ql/src/test/results/clientpositive/input17.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/input5.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/input_dynamicserde.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/input_testxpath.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/input_testxpath3.q.out
    hadoop/hive/trunk/serde/src/test/org/apache/hadoop/hive/serde2/thrift_test/CreateSequenceFile.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=732571&r1=732570&r2=732571&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Wed Jan  7 16:46:06 2009
@@ -71,6 +71,8 @@
 
   BUG FIXES
 
+    HIVE-161. Fixed xpath x.y when x is a null list. (zshao)
+
     HIVE-206. Fixed partition pruning check for uppercase table names.
     (Ashish Thusoo via zshao)
 

Modified: hadoop/hive/trunk/data/files/complex.seq
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/data/files/complex.seq?rev=732571&r1=732570&r2=732571&view=diff
==============================================================================
Binary files - no diff available.

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeFieldEvaluator.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeFieldEvaluator.java?rev=732571&r1=732570&r2=732571&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeFieldEvaluator.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExprNodeFieldEvaluator.java Wed Jan  7 16:46:06 2009
@@ -61,11 +61,15 @@
     result.oi = resultObjectInspector;
     if (desc.getIsList()) {
       List<?> list = ((ListObjectInspector)leftInspectableObject.oi).getList(leftInspectableObject.o);
-      List<Object> r = new ArrayList<Object>(list.size());
-      for(int i=0; i<list.size(); i++) {
-        r.add(structObjectInspector.getStructFieldData(list.get(i), field));
+      if (list == null) {
+        result.o = null;
+      } else {
+        List<Object> r = new ArrayList<Object>(list.size());
+        for(int i=0; i<list.size(); i++) {
+          r.add(structObjectInspector.getStructFieldData(list.get(i), field));
+        }
+        result.o = r;
       }
-      result.o = r;
     } else {
       result.o = structObjectInspector.getStructFieldData(leftInspectableObject.o, field);
     }

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/input17.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/input17.q.out?rev=732571&r1=732570&r2=732571&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/input17.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/input17.q.out Wed Jan  7 16:46:06 2009
@@ -76,13 +76,14 @@
                 name: dest1
 
 
--1103622755	{"myint":64,"mystring":"512"}
--1147582749	{"myint":1,"mystring":"1"}
--1220068486	{"myint":0,"mystring":"0"}
--1281615204	{"myint":36,"mystring":"216"}
--1587372270	{"myint":9,"mystring":"27"}
--1883609158	{"myint":81,"mystring":"729"}
--2091002568	{"myint":4,"mystring":"8"}
--240543261	{"myint":16,"mystring":"64"}
-1539139271	{"myint":49,"mystring":"343"}
-1914724542	{"myint":25,"mystring":"125"}
+NULL	{"myint":null,"mystring":null}
+-1461153966	{"myint":49,"mystring":"343"}
+-1952710705	{"myint":25,"mystring":"125"}
+-734328905	{"myint":16,"mystring":"64"}
+-751827636	{"myint":4,"mystring":"8"}
+1244525196	{"myint":36,"mystring":"216"}
+1638581586	{"myint":64,"mystring":"512"}
+1712634731	{"myint":0,"mystring":"0"}
+336964422	{"myint":81,"mystring":"729"}
+465985201	{"myint":1,"mystring":"1"}
+477111225	{"myint":9,"mystring":"27"}

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/input5.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/input5.q.out?rev=732571&r1=732570&r2=732571&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/input5.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/input5.q.out Wed Jan  7 16:46:06 2009
@@ -78,3 +78,4 @@
 [7,14,21]	[{"myint":49,"mystring":"343"}]
 [8,16,24]	[{"myint":64,"mystring":"512"}]
 [9,18,27]	[{"myint":81,"mystring":"729"}]
+null	null

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/input_dynamicserde.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/input_dynamicserde.q.out?rev=732571&r1=732570&r2=732571&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/input_dynamicserde.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/input_dynamicserde.q.out Wed Jan  7 16:46:06 2009
@@ -53,23 +53,25 @@
                 name: dest1
 
 
-[0,0,0]	["0","0","0"]	{"key_0":"value_0"}	-1220068486	record_0
-[1,2,3]	["10","100","1000"]	{"key_1":"value_1"}	-1147582750	record_1
-[2,4,6]	["20","200","2000"]	{"key_2":"value_2"}	-2091002570	record_2
-[3,6,9]	["30","300","3000"]	{"key_3":"value_3"}	-1587372273	record_3
-[4,8,12]	["40","400","4000"]	{"key_4":"value_4"}	-240543265	record_4
-[5,10,15]	["50","500","5000"]	{"key_5":"value_5"}	1914724537	record_5
-[6,12,18]	["60","600","6000"]	{"key_6":"value_6"}	-1281615210	record_6
-[7,14,21]	["70","700","7000"]	{"key_7":"value_7"}	1539139264	record_7
-[8,16,24]	["80","800","8000"]	{"key_8":"value_8"}	-1103622763	record_8
-[9,18,27]	["90","900","9000"]	{"key_9":"value_9"}	-1883609167	record_9
-0	0	NULL	-1220068486	record_0
-1	10	NULL	-1147582750	record_1
-2	20	NULL	-2091002570	record_2
-3	30	NULL	-1587372273	record_3
-4	40	NULL	-240543265	record_4
-5	50	NULL	1914724537	record_5
-6	60	NULL	-1281615210	record_6
-7	70	NULL	1539139264	record_7
-8	80	NULL	-1103622763	record_8
-9	90	NULL	-1883609167	record_9
+[0,0,0]	["0","0","0"]	{"key_0":"value_0"}	1712634731	record_0
+[1,2,3]	["10","100","1000"]	{"key_1":"value_1"}	465985200	record_1
+[2,4,6]	["20","200","2000"]	{"key_2":"value_2"}	-751827638	record_2
+[3,6,9]	["30","300","3000"]	{"key_3":"value_3"}	477111222	record_3
+[4,8,12]	["40","400","4000"]	{"key_4":"value_4"}	-734328909	record_4
+[5,10,15]	["50","500","5000"]	{"key_5":"value_5"}	-1952710710	record_5
+[6,12,18]	["60","600","6000"]	{"key_6":"value_6"}	1244525190	record_6
+[7,14,21]	["70","700","7000"]	{"key_7":"value_7"}	-1461153973	record_7
+[8,16,24]	["80","800","8000"]	{"key_8":"value_8"}	1638581578	record_8
+[9,18,27]	["90","900","9000"]	{"key_9":"value_9"}	336964413	record_9
+null	null	null	0	NULL
+0	0	NULL	1712634731	record_0
+1	10	NULL	465985200	record_1
+2	20	NULL	-751827638	record_2
+3	30	NULL	477111222	record_3
+4	40	NULL	-734328909	record_4
+5	50	NULL	-1952710710	record_5
+6	60	NULL	1244525190	record_6
+7	70	NULL	-1461153973	record_7
+8	80	NULL	1638581578	record_8
+9	90	NULL	336964413	record_9
+NULL	NULL	NULL	0	NULL

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/input_testxpath.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/input_testxpath.q.out?rev=732571&r1=732570&r2=732571&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/input_testxpath.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/input_testxpath.q.out Wed Jan  7 16:46:06 2009
@@ -55,3 +55,4 @@
 14	343	NULL
 16	512	NULL
 18	729	NULL
+NULL	NULL	NULL

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/input_testxpath3.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/input_testxpath3.q.out?rev=732571&r1=732570&r2=732571&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/input_testxpath3.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/input_testxpath3.q.out Wed Jan  7 16:46:06 2009
@@ -43,3 +43,4 @@
 NULL	[49]
 NULL	[64]
 value_9	[81]
+NULL	null

Modified: hadoop/hive/trunk/serde/src/test/org/apache/hadoop/hive/serde2/thrift_test/CreateSequenceFile.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/test/org/apache/hadoop/hive/serde2/thrift_test/CreateSequenceFile.java?rev=732571&r1=732570&r2=732571&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/test/org/apache/hadoop/hive/serde2/thrift_test/CreateSequenceFile.java (original)
+++ hadoop/hive/trunk/serde/src/test/org/apache/hadoop/hive/serde2/thrift_test/CreateSequenceFile.java Wed Jan  7 16:46:06 2009
@@ -98,7 +98,12 @@
       Writable value = serde.serialize(complex);
       writer.append(key, value);
     }
-    
+
+    // Add an all-null record
+    Complex complex = new Complex(0, null, null, null, null, null);
+    Writable value = serde.serialize(complex);
+    writer.append(key, value);
+
     // Close files
     writer.close();
   }