hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1602499 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java test/queries/clientpositive/windowing.q test/results/clientpositive/windowing.q.out
Date Fri, 13 Jun 2014 19:08:44 GMT
Author: hashutosh
Date: Fri Jun 13 19:08:43 2014
New Revision: 1602499

URL: http://svn.apache.org/r1602499
Log:
HIVE-7226 : Windowing Streaming mode causes NPE for empty partitions (Harish Butani via Ashutosh
Chauhan)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java
    hive/trunk/ql/src/test/queries/clientpositive/windowing.q
    hive/trunk/ql/src/test/results/clientpositive/windowing.q.out

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java?rev=1602499&r1=1602498&r2=1602499&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/WindowingTableFunction.java Fri
Jun 13 19:08:43 2014
@@ -1319,6 +1319,7 @@ public class WindowingTableFunction exte
         fnOutputs[i] = new ArrayList<Object>();
         WindowFunctionDef wFn = tabDef.getWindowFunctions().get(i);
         funcArgs[i] = new Object[wFn.getArgs() == null ? 0 : wFn.getArgs().size()];
+        aggBuffers[i] = wFn.getWFnEval().getNewAggregationBuffer();
       }
     }
 

Modified: hive/trunk/ql/src/test/queries/clientpositive/windowing.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/windowing.q?rev=1602499&r1=1602498&r2=1602499&view=diff
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/windowing.q (original)
+++ hive/trunk/ql/src/test/queries/clientpositive/windowing.q Fri Jun 13 19:08:43 2014
@@ -431,4 +431,10 @@ select p_name, p_retailprice,
 round(avg(p_retailprice) over(),2)
 from part
 order by p_name;
-        
+
+-- 45. empty partition test
+select p_mfgr, 
+  sum(p_size) over (partition by p_mfgr order by p_size rows between unbounded preceding
and current row) 
+from part 
+where p_mfgr = 'Manufacturer#6'
+;

Modified: hive/trunk/ql/src/test/results/clientpositive/windowing.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/windowing.q.out?rev=1602499&r1=1602498&r2=1602499&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/windowing.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/windowing.q.out Fri Jun 13 19:08:43 2014
@@ -2314,3 +2314,19 @@ almond aquamarine sandy cyan gainsboro	1
 almond aquamarine yellow dodger mint	1844.92	1546.78
 almond azure aquamarine papaya violet	1290.35	1546.78
 almond azure blanched chiffon midnight	1464.48	1546.78
+PREHOOK: query: -- 45. empty partition test
+select p_mfgr, 
+  sum(p_size) over (partition by p_mfgr order by p_size rows between unbounded preceding
and current row) 
+from part 
+where p_mfgr = 'Manufacturer#6'
+PREHOOK: type: QUERY
+PREHOOK: Input: default@part
+#### A masked pattern was here ####
+POSTHOOK: query: -- 45. empty partition test
+select p_mfgr, 
+  sum(p_size) over (partition by p_mfgr order by p_size rows between unbounded preceding
and current row) 
+from part 
+where p_mfgr = 'Manufacturer#6'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@part
+#### A masked pattern was here ####



Mime
View raw message