hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgyrtk...@apache.org
Subject [5/5] hive git commit: HIVE-17375: stddev_samp, var_samp standard compliance (Zoltan Haindrich, reviewed by Ashutosh Chauhan)
Date Mon, 28 Aug 2017 21:08:18 GMT
HIVE-17375: stddev_samp,var_samp standard compliance (Zoltan Haindrich, reviewed by Ashutosh
Chauhan)

Signed-off-by: Zoltan Haindrich <kirk@rxd.hu>


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/dd04a92f
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/dd04a92f
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/dd04a92f

Branch: refs/heads/master
Commit: dd04a92f7178df2ef26ca0b76bd2985c34a7dbaf
Parents: e352ef4
Author: Zoltan Haindrich <kirk@rxd.hu>
Authored: Mon Aug 28 22:19:53 2017 +0200
Committer: Zoltan Haindrich <kirk@rxd.hu>
Committed: Mon Aug 28 23:06:46 2017 +0200

----------------------------------------------------------------------
 .../ql/udf/generic/GenericUDAFStdSample.java    |   13 +-
 .../udf/generic/GenericUDAFVarianceSample.java  |   13 +-
 .../queries/clientpositive/udf_stddev_samp.q    |    9 +
 .../test/queries/clientpositive/udf_var_samp.q  |    9 +
 .../results/clientpositive/decimal_udf.q.out    |   24 +-
 .../clientpositive/llap/vectorization_15.q.out  |   94 +-
 .../clientpositive/spark/vectorization_15.q.out |   94 +-
 .../clientpositive/udf_stddev_samp.q.out        |   66 +-
 .../results/clientpositive/udf_var_samp.q.out   |   66 +-
 .../clientpositive/vectorization_12.q.out       | 1064 +++++++--------
 .../clientpositive/vectorization_14.q.out       | 1244 +++++++++---------
 .../clientpositive/vectorization_15.q.out       |   94 +-
 .../clientpositive/vectorization_16.q.out       |  322 ++---
 .../clientpositive/vectorization_9.q.out        |  322 ++---
 14 files changed, 1783 insertions(+), 1651 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/dd04a92f/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFStdSample.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFStdSample.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFStdSample.java
index e85046c..e032982 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFStdSample.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFStdSample.java
@@ -31,7 +31,10 @@ import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
  *
  */
 @Description(name = "stddev_samp",
-    value = "_FUNC_(x) - Returns the sample standard deviation of a set of numbers")
+    value = "_FUNC_(x) - Returns the sample standard deviation of a set of numbers.\n"
+          + "If applied to an empty set: NULL is returned.\n"
+          + "If applied to a set with a single element: NULL is returned.\n"
+          + "Otherwise it computes: sqrt(var_samp(x))")
 public class GenericUDAFStdSample extends GenericUDAFVariance {
 
   @Override
@@ -78,14 +81,10 @@ public class GenericUDAFStdSample extends GenericUDAFVariance {
     public Object terminate(AggregationBuffer agg) throws HiveException {
       StdAgg myagg = (StdAgg) agg;
 
-      if (myagg.count == 0) { // SQL standard - return null for zero elements
+      if (myagg.count <= 1) { // SQL standard - return null for zero or one elements
         return null;
       } else {
-        if (myagg.count > 1) {
-          getResult().set(Math.sqrt(myagg.variance / (myagg.count - 1)));
-        } else { // for one element the variance is always 0
-          getResult().set(0);
-        }
+        getResult().set(Math.sqrt(myagg.variance / (myagg.count - 1)));
         return getResult();
       }
     }

http://git-wip-us.apache.org/repos/asf/hive/blob/dd04a92f/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFVarianceSample.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFVarianceSample.java
b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFVarianceSample.java
index ab863be..8815086 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFVarianceSample.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFVarianceSample.java
@@ -31,7 +31,10 @@ import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
  *
  */
 @Description(name = "var_samp",
-    value = "_FUNC_(x) - Returns the sample variance of a set of numbers")
+    value = "_FUNC_(x) - Returns the sample variance of a set of numbers.\n"
+          + "If applied to an empty set: NULL is returned.\n"
+          + "If applied to a set with a single element: NULL is returned.\n"
+          + "Otherwise it computes: (S2-S1*S1/N)/(N-1)")
 public class GenericUDAFVarianceSample extends GenericUDAFVariance {
 
   @Override
@@ -78,14 +81,10 @@ public class GenericUDAFVarianceSample extends GenericUDAFVariance {
     public Object terminate(AggregationBuffer agg) throws HiveException {
       StdAgg myagg = (StdAgg) agg;
 
-      if (myagg.count == 0) { // SQL standard - return null for zero elements
+      if (myagg.count <= 1) {
         return null;
       } else {
-        if (myagg.count > 1) {
-          getResult().set(myagg.variance / (myagg.count - 1));
-        } else { // for one element the variance is always 0
-          getResult().set(0);
-        }
+        getResult().set(myagg.variance / (myagg.count - 1));
         return getResult();
       }
     }

http://git-wip-us.apache.org/repos/asf/hive/blob/dd04a92f/ql/src/test/queries/clientpositive/udf_stddev_samp.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/udf_stddev_samp.q b/ql/src/test/queries/clientpositive/udf_stddev_samp.q
index 30d2f24..76e479d 100644
--- a/ql/src/test/queries/clientpositive/udf_stddev_samp.q
+++ b/ql/src/test/queries/clientpositive/udf_stddev_samp.q
@@ -2,3 +2,12 @@ DESCRIBE FUNCTION stddev_samp;
 DESCRIBE FUNCTION EXTENDED stddev_samp;
 DESCRIBE FUNCTION stddev_samp;
 DESCRIBE FUNCTION EXTENDED stddev_samp;
+
+
+drop table if exists t;
+create table t (a int);
+insert into t values (1),(-1),(0);
+
+select stddev_samp(a) from t;
+select stddev_samp(a) from t where a=0;
+select round(stddev_samp(a),5) from t where a>=0;

http://git-wip-us.apache.org/repos/asf/hive/blob/dd04a92f/ql/src/test/queries/clientpositive/udf_var_samp.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/udf_var_samp.q b/ql/src/test/queries/clientpositive/udf_var_samp.q
index de68e49..710cbf0 100644
--- a/ql/src/test/queries/clientpositive/udf_var_samp.q
+++ b/ql/src/test/queries/clientpositive/udf_var_samp.q
@@ -2,3 +2,12 @@ DESCRIBE FUNCTION var_samp;
 DESCRIBE FUNCTION EXTENDED var_samp;
 DESCRIBE FUNCTION var_samp;
 DESCRIBE FUNCTION EXTENDED var_samp;
+
+drop table if exists t;
+create table t (a int);
+insert into t values (1),(-1),(0);
+
+select var_samp(a) from t;
+select var_samp(a) from t where a=0;
+select round(var_samp(a),5) from t where a>=0;
+

http://git-wip-us.apache.org/repos/asf/hive/blob/dd04a92f/ql/src/test/results/clientpositive/decimal_udf.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/decimal_udf.q.out b/ql/src/test/results/clientpositive/decimal_udf.q.out
index 515fc7d..8bda27a 100644
--- a/ql/src/test/results/clientpositive/decimal_udf.q.out
+++ b/ql/src/test/results/clientpositive/decimal_udf.q.out
@@ -1970,23 +1970,23 @@ POSTHOOK: query: SELECT value, stddev_samp(key), var_samp(key) FROM
DECIMAL_UDF
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@decimal_udf
 #### A masked pattern was here ####
--1234567890	0.0	0.0
--1255	0.0	0.0
--11	0.0	0.0
+-1234567890	NULL	NULL
+-1255	NULL	NULL
+-11	NULL	NULL
 -1	0.0	0.0
 0	0.2348228191855647	0.055141756410256405
 1	0.06627820154470102	0.004392800000000008
 2	0.0	0.0
 3	0.0	0.0
-4	0.0	0.0
-10	0.0	0.0
-20	0.0	0.0
-100	0.0	0.0
-124	0.0	0.0
-125	0.0	0.0
-200	0.0	0.0
-4400	0.0	0.0
-1234567890	0.0	0.0
+4	NULL	NULL
+10	NULL	NULL
+20	NULL	NULL
+100	NULL	NULL
+124	NULL	NULL
+125	NULL	NULL
+200	NULL	NULL
+4400	NULL	NULL
+1234567890	NULL	NULL
 PREHOOK: query: EXPLAIN SELECT histogram_numeric(key, 3) FROM DECIMAL_UDF
 PREHOOK: type: QUERY
 POSTHOOK: query: EXPLAIN SELECT histogram_numeric(key, 3) FROM DECIMAL_UDF

http://git-wip-us.apache.org/repos/asf/hive/blob/dd04a92f/ql/src/test/results/clientpositive/llap/vectorization_15.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/vectorization_15.q.out b/ql/src/test/results/clientpositive/llap/vectorization_15.q.out
index 79c7084..9cc350d 100644
--- a/ql/src/test/results/clientpositive/llap/vectorization_15.q.out
+++ b/ql/src/test/results/clientpositive/llap/vectorization_15.q.out
@@ -259,50 +259,50 @@ ORDER BY cfloat, cboolean1, cdouble, cstring1, ctinyint, cint, ctimestamp1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@alltypesorc
 #### A masked pattern was here ####
--48.0	NULL	-7196.0	NULL	-48	NULL	1969-12-31 16:00:06.337	0.0	NULL	-7196.0	-572463.388	33.0
0.0	0.0	-23.0	48	NULL	NULL	-23	NULL	NULL
--51.0	NULL	-200.0	NULL	-51	NULL	1969-12-31 15:59:55.423	0.0	NULL	-200.0	-15910.599999999999
33.0	0.0	0.0	-23.0	51	NULL	NULL	-23	NULL	NULL
--51.0	false	NULL	10	-51	1058319346	1969-12-31 16:00:08.451	0.0	-1058319372.28	NULL	NULL	33.0
0.0	0.0	NULL	51	0.0	1.05831942E9	-23	1058319372.28	0.0
--51.0	false	NULL	10TYIE5S35U6dj3N	-51	-469581869	1969-12-31 16:00:08.451	0.0	469581842.72
NULL	NULL	33.0	0.0	0.0	NULL	51	0.0	-4.69581792E8	-23	-469581842.72	0.0
--51.0	false	NULL	1Lh6Uoq3WhNtOqQHu7WN7U	-51	-352637533	1969-12-31 16:00:08.451	0.0	352637506.72
NULL	NULL	33.0	0.0	0.0	NULL	51	0.0	-3.52637472E8	-23	-352637506.72	0.0
--51.0	true	NULL	04Y1mA17	-51	-114647521	1969-12-31 16:00:08.451	0.0	114647494.72	NULL	NULL
33.0	0.0	0.0	NULL	51	0.0	-1.14647472E8	-23	-114647494.72	0.0
--51.0	true	NULL	10Wu570aLPO0p02P17FeH	-51	405338893	1969-12-31 16:00:08.451	0.0	-405338919.28
NULL	NULL	33.0	0.0	0.0	NULL	51	0.0	4.05338944E8	-23	405338919.28	0.0
--51.0	true	NULL	3cQp060	-51	-226923315	1969-12-31 16:00:08.451	0.0	226923288.72	NULL	NULL
33.0	0.0	0.0	NULL	51	0.0	-2.26923264E8	-23	-226923288.72	0.0
--51.0	true	NULL	8EPG0Xi307qd	-51	-328662044	1969-12-31 16:00:08.451	0.0	328662017.72	NULL
NULL	33.0	0.0	0.0	NULL	51	0.0	-3.28661984E8	-23	-328662017.72	0.0
--51.0	true	NULL	8iHtdkJ6d	-51	1006818344	1969-12-31 16:00:08.451	0.0	-1006818370.28	NULL
NULL	33.0	0.0	0.0	NULL	51	0.0	1.00681843E9	-23	1006818370.28	0.0
--51.0	true	NULL	QiOcvR0kt6r7f0R7fiPxQTCU	-51	266531954	1969-12-31 16:00:08.451	0.0	-266531980.28
NULL	NULL	33.0	0.0	0.0	NULL	51	0.0	2.66532E8	-23	266531980.28	0.0
--51.0	true	NULL	Ybpj38RTTYl7CnJXPNx1g4C	-51	-370919370	1969-12-31 16:00:08.451	0.0	370919343.72
NULL	NULL	33.0	0.0	0.0	NULL	51	0.0	-3.70919296E8	-23	-370919343.72	0.0
--6.0	NULL	-200.0	NULL	-6	NULL	1969-12-31 15:59:56.094	0.0	NULL	-200.0	-15910.599999999999
3.0	0.0	0.0	-23.0	6	NULL	NULL	-5	NULL	NULL
--62.0	NULL	15601.0	NULL	-62	NULL	1969-12-31 15:59:56.527	0.0	NULL	15601.0	1241106.353	33.0
0.0	0.0	-23.0	62	NULL	NULL	-23	NULL	NULL
-11.0	false	NULL	10pO8p1LNx4Y	11	271296824	1969-12-31 16:00:02.351	0.0	-271296850.28	NULL
NULL	0.0	0.0	0.0	NULL	-11	0.0	2.71296832E8	-1	271296850.28	0.0
-11.0	false	NULL	1H6wGP	11	-560827082	1969-12-31 16:00:02.351	0.0	560827055.72	NULL	NULL	0.0
0.0	0.0	NULL	-11	0.0	-5.6082707E8	-1	-560827055.72	0.0
-11.0	false	NULL	2a7V63IL7jK3o	11	-325931647	1969-12-31 16:00:02.351	0.0	325931620.72	NULL
NULL	0.0	0.0	0.0	NULL	-11	0.0	-3.25931648E8	-1	-325931620.72	0.0
-11.0	true	NULL	10	11	92365813	1969-12-31 16:00:02.351	0.0	-92365839.28	NULL	NULL	0.0	0.0
0.0	NULL	-11	0.0	9.2365808E7	-1	92365839.28	0.0
-21.0	NULL	15601.0	NULL	21	NULL	1969-12-31 15:59:56.527	0.0	NULL	15601.0	1241106.353	12.0
0.0	0.0	-23.0	-21	NULL	NULL	-2	NULL	NULL
-32.0	NULL	-200.0	NULL	32	NULL	1969-12-31 16:00:02.445	0.0	NULL	-200.0	-15910.599999999999
1.0	0.0	0.0	-23.0	-32	NULL	NULL	-23	NULL	NULL
-36.0	NULL	-200.0	NULL	36	NULL	1969-12-31 16:00:00.554	0.0	NULL	-200.0	-15910.599999999999
33.0	0.0	0.0	-23.0	-36	NULL	NULL	-23	NULL	NULL
-5.0	NULL	15601.0	NULL	5	NULL	1969-12-31 15:59:56.527	0.0	NULL	15601.0	1241106.353	3.0	0.0
0.0	-23.0	-5	NULL	NULL	-3	NULL	NULL
-58.0	NULL	15601.0	NULL	58	NULL	1969-12-31 15:59:56.527	0.0	NULL	15601.0	1241106.353	33.0
0.0	0.0	-23.0	-58	NULL	NULL	-23	NULL	NULL
-8.0	false	NULL	10V3pN5r5lI2qWl2lG103	8	-362835731	1969-12-31 16:00:15.892	0.0	362835704.72
NULL	NULL	1.0	0.0	0.0	NULL	-8	0.0	-3.62835744E8	-7	-362835704.72	0.0
-8.0	false	NULL	10c4qt584m5y6uWT	8	-183000142	1969-12-31 16:00:15.892	0.0	183000115.72	NULL
NULL	1.0	0.0	0.0	NULL	-8	0.0	-1.8300016E8	-7	-183000115.72	0.0
-8.0	false	NULL	8GloEukQ0c68JDmnYL53	8	-722873402	1969-12-31 16:00:15.892	0.0	722873375.72
NULL	NULL	1.0	0.0	0.0	NULL	-8	0.0	-7.2287341E8	-7	-722873375.72	0.0
-8.0	false	NULL	kA0XH5C5	8	-503903864	1969-12-31 16:00:15.892	0.0	503903837.72	NULL	NULL	1.0
0.0	0.0	NULL	-8	0.0	-5.03903872E8	-7	-503903837.72	0.0
-8.0	true	NULL	100VTM7PEW8GH1uE	8	88129338	1969-12-31 16:00:15.892	0.0	-88129364.28	NULL	NULL
1.0	0.0	0.0	NULL	-8	0.0	8.8129328E7	-7	88129364.28	0.0
-8.0	true	NULL	1062158y	8	-1005155523	1969-12-31 16:00:15.892	0.0	1005155496.72	NULL	NULL
1.0	0.0	0.0	NULL	-8	0.0	-1.00515552E9	-7	-1005155496.72	0.0
-8.0	true	NULL	1063cEnGjSal	8	-624769630	1969-12-31 16:00:15.892	0.0	624769603.72	NULL	NULL
1.0	0.0	0.0	NULL	-8	0.0	-6.247696E8	-7	-624769603.72	0.0
-8.0	true	NULL	4kMasVoB7lX1wc5i64bNk	8	683567667	1969-12-31 16:00:15.892	0.0	-683567693.28
NULL	NULL	1.0	0.0	0.0	NULL	-8	0.0	6.8356768E8	-7	683567693.28	0.0
-8.0	true	NULL	XH6I7A417	8	436627202	1969-12-31 16:00:15.892	0.0	-436627228.28	NULL	NULL	1.0
0.0	0.0	NULL	-8	0.0	4.366272E8	-7	436627228.28	0.0
-NULL	false	-13008.0	10	NULL	-896629175	NULL	NULL	896629148.72	-13008.0	-1034825.424	NULL
NULL	NULL	-23.0	NULL	0.0	NULL	NULL	-896629148.72	0.0
-NULL	false	-7707.0	10vke853	NULL	424959354	NULL	NULL	-424959380.28	-7707.0	-613114.971	NULL
NULL	NULL	-23.0	NULL	0.0	NULL	NULL	424959380.28	0.0
-NULL	false	14771.0	10	NULL	993788576	NULL	NULL	-993788602.28	14771.0	1175077.363	NULL	NULL
NULL	-23.0	NULL	0.0	NULL	NULL	993788602.28	0.0
-NULL	false	2459.0	10	NULL	-394064473	NULL	NULL	394064446.72	2459.0	195620.827	NULL	NULL	NULL
-23.0	NULL	0.0	NULL	NULL	-394064446.72	0.0
-NULL	true	-14640.0	101n6n461o	NULL	-819657767	NULL	NULL	819657740.72	-14640.0	-1164655.92
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	-819657740.72	0.0
-NULL	true	-14674.0	105aFDAt30c4rI4U	NULL	-831072496	NULL	NULL	831072469.72	-14674.0	-1167360.722
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	-831072469.72	0.0
-NULL	true	-7238.0	10ljXCFT6fG6Qi3S7414e	NULL	-256767096	NULL	NULL	256767069.72	-7238.0	-575804.614
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	-256767069.72	0.0
-NULL	true	-9489.0	10Yr6	NULL	500274721	NULL	NULL	-500274747.28	-9489.0	-754878.417	NULL	NULL
NULL	-23.0	NULL	0.0	NULL	NULL	500274747.28	0.0
-NULL	true	10419.0	10	NULL	-721614386	NULL	NULL	721614359.72	10419.0	828862.7069999999	NULL
NULL	NULL	-23.0	NULL	0.0	NULL	NULL	-721614359.72	0.0
-NULL	true	14519.0	100xJdkyc	NULL	729277608	NULL	NULL	-729277634.28	14519.0	1155030.007	NULL
NULL	NULL	-23.0	NULL	0.0	NULL	NULL	729277634.28	0.0
-NULL	true	2261.0	10Hr5oB07Ohu0622u	NULL	612000160	NULL	NULL	-612000186.28	2261.0	179869.33299999998
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	612000186.28	0.0
-NULL	true	4516.0	10lL0XD6WP2x64f70N0fHmC1	NULL	-974538365	NULL	NULL	974538338.72	4516.0	359261.348
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	-974538338.72	0.0
-NULL	true	4767.0	10dUdwyXp5XwgpkTxLffmv3x	NULL	187503456	NULL	NULL	-187503482.28	4767.0	379229.151
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	187503482.28	0.0
-NULL	true	5658.0	10M3eGUsKVonbl70DyoCk25	NULL	486382507	NULL	NULL	-486382533.28	5658.0	450110.874
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	486382533.28	0.0
-NULL	true	8659.0	1047piRsT3c3r134I	NULL	487236176	NULL	NULL	-487236202.28	8659.0	688849.427
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	487236202.28	0.0
+-48.0	NULL	-7196.0	NULL	-48	NULL	1969-12-31 16:00:06.337	NULL	NULL	-7196.0	-572463.388	33.0
NULL	0.0	-23.0	48	NULL	NULL	-23	NULL	NULL
+-51.0	NULL	-200.0	NULL	-51	NULL	1969-12-31 15:59:55.423	NULL	NULL	-200.0	-15910.599999999999
33.0	NULL	0.0	-23.0	51	NULL	NULL	-23	NULL	NULL
+-51.0	false	NULL	10	-51	1058319346	1969-12-31 16:00:08.451	NULL	-1058319372.28	NULL	NULL
33.0	NULL	0.0	NULL	51	NULL	1.05831942E9	-23	1058319372.28	0.0
+-51.0	false	NULL	10TYIE5S35U6dj3N	-51	-469581869	1969-12-31 16:00:08.451	NULL	469581842.72
NULL	NULL	33.0	NULL	0.0	NULL	51	NULL	-4.69581792E8	-23	-469581842.72	0.0
+-51.0	false	NULL	1Lh6Uoq3WhNtOqQHu7WN7U	-51	-352637533	1969-12-31 16:00:08.451	NULL	352637506.72
NULL	NULL	33.0	NULL	0.0	NULL	51	NULL	-3.52637472E8	-23	-352637506.72	0.0
+-51.0	true	NULL	04Y1mA17	-51	-114647521	1969-12-31 16:00:08.451	NULL	114647494.72	NULL	NULL
33.0	NULL	0.0	NULL	51	NULL	-1.14647472E8	-23	-114647494.72	0.0
+-51.0	true	NULL	10Wu570aLPO0p02P17FeH	-51	405338893	1969-12-31 16:00:08.451	NULL	-405338919.28
NULL	NULL	33.0	NULL	0.0	NULL	51	NULL	4.05338944E8	-23	405338919.28	0.0
+-51.0	true	NULL	3cQp060	-51	-226923315	1969-12-31 16:00:08.451	NULL	226923288.72	NULL	NULL
33.0	NULL	0.0	NULL	51	NULL	-2.26923264E8	-23	-226923288.72	0.0
+-51.0	true	NULL	8EPG0Xi307qd	-51	-328662044	1969-12-31 16:00:08.451	NULL	328662017.72	NULL
NULL	33.0	NULL	0.0	NULL	51	NULL	-3.28661984E8	-23	-328662017.72	0.0
+-51.0	true	NULL	8iHtdkJ6d	-51	1006818344	1969-12-31 16:00:08.451	NULL	-1006818370.28	NULL
NULL	33.0	NULL	0.0	NULL	51	NULL	1.00681843E9	-23	1006818370.28	0.0
+-51.0	true	NULL	QiOcvR0kt6r7f0R7fiPxQTCU	-51	266531954	1969-12-31 16:00:08.451	NULL	-266531980.28
NULL	NULL	33.0	NULL	0.0	NULL	51	NULL	2.66532E8	-23	266531980.28	0.0
+-51.0	true	NULL	Ybpj38RTTYl7CnJXPNx1g4C	-51	-370919370	1969-12-31 16:00:08.451	NULL	370919343.72
NULL	NULL	33.0	NULL	0.0	NULL	51	NULL	-3.70919296E8	-23	-370919343.72	0.0
+-6.0	NULL	-200.0	NULL	-6	NULL	1969-12-31 15:59:56.094	NULL	NULL	-200.0	-15910.599999999999
3.0	NULL	0.0	-23.0	6	NULL	NULL	-5	NULL	NULL
+-62.0	NULL	15601.0	NULL	-62	NULL	1969-12-31 15:59:56.527	NULL	NULL	15601.0	1241106.353	33.0
NULL	0.0	-23.0	62	NULL	NULL	-23	NULL	NULL
+11.0	false	NULL	10pO8p1LNx4Y	11	271296824	1969-12-31 16:00:02.351	NULL	-271296850.28	NULL
NULL	0.0	NULL	0.0	NULL	-11	NULL	2.71296832E8	-1	271296850.28	0.0
+11.0	false	NULL	1H6wGP	11	-560827082	1969-12-31 16:00:02.351	NULL	560827055.72	NULL	NULL
0.0	NULL	0.0	NULL	-11	NULL	-5.6082707E8	-1	-560827055.72	0.0
+11.0	false	NULL	2a7V63IL7jK3o	11	-325931647	1969-12-31 16:00:02.351	NULL	325931620.72	NULL
NULL	0.0	NULL	0.0	NULL	-11	NULL	-3.25931648E8	-1	-325931620.72	0.0
+11.0	true	NULL	10	11	92365813	1969-12-31 16:00:02.351	NULL	-92365839.28	NULL	NULL	0.0	NULL
0.0	NULL	-11	NULL	9.2365808E7	-1	92365839.28	0.0
+21.0	NULL	15601.0	NULL	21	NULL	1969-12-31 15:59:56.527	NULL	NULL	15601.0	1241106.353	12.0
NULL	0.0	-23.0	-21	NULL	NULL	-2	NULL	NULL
+32.0	NULL	-200.0	NULL	32	NULL	1969-12-31 16:00:02.445	NULL	NULL	-200.0	-15910.599999999999
1.0	NULL	0.0	-23.0	-32	NULL	NULL	-23	NULL	NULL
+36.0	NULL	-200.0	NULL	36	NULL	1969-12-31 16:00:00.554	NULL	NULL	-200.0	-15910.599999999999
33.0	NULL	0.0	-23.0	-36	NULL	NULL	-23	NULL	NULL
+5.0	NULL	15601.0	NULL	5	NULL	1969-12-31 15:59:56.527	NULL	NULL	15601.0	1241106.353	3.0	NULL
0.0	-23.0	-5	NULL	NULL	-3	NULL	NULL
+58.0	NULL	15601.0	NULL	58	NULL	1969-12-31 15:59:56.527	NULL	NULL	15601.0	1241106.353	33.0
NULL	0.0	-23.0	-58	NULL	NULL	-23	NULL	NULL
+8.0	false	NULL	10V3pN5r5lI2qWl2lG103	8	-362835731	1969-12-31 16:00:15.892	NULL	362835704.72
NULL	NULL	1.0	NULL	0.0	NULL	-8	NULL	-3.62835744E8	-7	-362835704.72	0.0
+8.0	false	NULL	10c4qt584m5y6uWT	8	-183000142	1969-12-31 16:00:15.892	NULL	183000115.72	NULL
NULL	1.0	NULL	0.0	NULL	-8	NULL	-1.8300016E8	-7	-183000115.72	0.0
+8.0	false	NULL	8GloEukQ0c68JDmnYL53	8	-722873402	1969-12-31 16:00:15.892	NULL	722873375.72
NULL	NULL	1.0	NULL	0.0	NULL	-8	NULL	-7.2287341E8	-7	-722873375.72	0.0
+8.0	false	NULL	kA0XH5C5	8	-503903864	1969-12-31 16:00:15.892	NULL	503903837.72	NULL	NULL
1.0	NULL	0.0	NULL	-8	NULL	-5.03903872E8	-7	-503903837.72	0.0
+8.0	true	NULL	100VTM7PEW8GH1uE	8	88129338	1969-12-31 16:00:15.892	NULL	-88129364.28	NULL
NULL	1.0	NULL	0.0	NULL	-8	NULL	8.8129328E7	-7	88129364.28	0.0
+8.0	true	NULL	1062158y	8	-1005155523	1969-12-31 16:00:15.892	NULL	1005155496.72	NULL	NULL
1.0	NULL	0.0	NULL	-8	NULL	-1.00515552E9	-7	-1005155496.72	0.0
+8.0	true	NULL	1063cEnGjSal	8	-624769630	1969-12-31 16:00:15.892	NULL	624769603.72	NULL	NULL
1.0	NULL	0.0	NULL	-8	NULL	-6.247696E8	-7	-624769603.72	0.0
+8.0	true	NULL	4kMasVoB7lX1wc5i64bNk	8	683567667	1969-12-31 16:00:15.892	NULL	-683567693.28
NULL	NULL	1.0	NULL	0.0	NULL	-8	NULL	6.8356768E8	-7	683567693.28	0.0
+8.0	true	NULL	XH6I7A417	8	436627202	1969-12-31 16:00:15.892	NULL	-436627228.28	NULL	NULL
1.0	NULL	0.0	NULL	-8	NULL	4.366272E8	-7	436627228.28	0.0
+NULL	false	-13008.0	10	NULL	-896629175	NULL	NULL	896629148.72	-13008.0	-1034825.424	NULL
NULL	NULL	-23.0	NULL	NULL	NULL	NULL	-896629148.72	0.0
+NULL	false	-7707.0	10vke853	NULL	424959354	NULL	NULL	-424959380.28	-7707.0	-613114.971	NULL
NULL	NULL	-23.0	NULL	NULL	NULL	NULL	424959380.28	0.0
+NULL	false	14771.0	10	NULL	993788576	NULL	NULL	-993788602.28	14771.0	1175077.363	NULL	NULL
NULL	-23.0	NULL	NULL	NULL	NULL	993788602.28	0.0
+NULL	false	2459.0	10	NULL	-394064473	NULL	NULL	394064446.72	2459.0	195620.827	NULL	NULL	NULL
-23.0	NULL	NULL	NULL	NULL	-394064446.72	0.0
+NULL	true	-14640.0	101n6n461o	NULL	-819657767	NULL	NULL	819657740.72	-14640.0	-1164655.92
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	-819657740.72	0.0
+NULL	true	-14674.0	105aFDAt30c4rI4U	NULL	-831072496	NULL	NULL	831072469.72	-14674.0	-1167360.722
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	-831072469.72	0.0
+NULL	true	-7238.0	10ljXCFT6fG6Qi3S7414e	NULL	-256767096	NULL	NULL	256767069.72	-7238.0	-575804.614
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	-256767069.72	0.0
+NULL	true	-9489.0	10Yr6	NULL	500274721	NULL	NULL	-500274747.28	-9489.0	-754878.417	NULL	NULL
NULL	-23.0	NULL	NULL	NULL	NULL	500274747.28	0.0
+NULL	true	10419.0	10	NULL	-721614386	NULL	NULL	721614359.72	10419.0	828862.7069999999	NULL
NULL	NULL	-23.0	NULL	NULL	NULL	NULL	-721614359.72	0.0
+NULL	true	14519.0	100xJdkyc	NULL	729277608	NULL	NULL	-729277634.28	14519.0	1155030.007	NULL
NULL	NULL	-23.0	NULL	NULL	NULL	NULL	729277634.28	0.0
+NULL	true	2261.0	10Hr5oB07Ohu0622u	NULL	612000160	NULL	NULL	-612000186.28	2261.0	179869.33299999998
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	612000186.28	0.0
+NULL	true	4516.0	10lL0XD6WP2x64f70N0fHmC1	NULL	-974538365	NULL	NULL	974538338.72	4516.0	359261.348
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	-974538338.72	0.0
+NULL	true	4767.0	10dUdwyXp5XwgpkTxLffmv3x	NULL	187503456	NULL	NULL	-187503482.28	4767.0	379229.151
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	187503482.28	0.0
+NULL	true	5658.0	10M3eGUsKVonbl70DyoCk25	NULL	486382507	NULL	NULL	-486382533.28	5658.0	450110.874
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	486382533.28	0.0
+NULL	true	8659.0	1047piRsT3c3r134I	NULL	487236176	NULL	NULL	-487236202.28	8659.0	688849.427
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	487236202.28	0.0

http://git-wip-us.apache.org/repos/asf/hive/blob/dd04a92f/ql/src/test/results/clientpositive/spark/vectorization_15.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/vectorization_15.q.out b/ql/src/test/results/clientpositive/spark/vectorization_15.q.out
index 6ef97c2..1b589f7 100644
--- a/ql/src/test/results/clientpositive/spark/vectorization_15.q.out
+++ b/ql/src/test/results/clientpositive/spark/vectorization_15.q.out
@@ -255,50 +255,50 @@ ORDER BY cfloat, cboolean1, cdouble, cstring1, ctinyint, cint, ctimestamp1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@alltypesorc
 #### A masked pattern was here ####
--48.0	NULL	-7196.0	NULL	-48	NULL	1969-12-31 16:00:06.337	0.0	NULL	-7196.0	-572463.388	33.0
0.0	0.0	-23.0	48	NULL	NULL	-23	NULL	NULL
--51.0	NULL	-200.0	NULL	-51	NULL	1969-12-31 15:59:55.423	0.0	NULL	-200.0	-15910.599999999999
33.0	0.0	0.0	-23.0	51	NULL	NULL	-23	NULL	NULL
--51.0	false	NULL	10	-51	1058319346	1969-12-31 16:00:08.451	0.0	-1058319372.28	NULL	NULL	33.0
0.0	0.0	NULL	51	0.0	1.05831942E9	-23	1058319372.28	0.0
--51.0	false	NULL	10TYIE5S35U6dj3N	-51	-469581869	1969-12-31 16:00:08.451	0.0	469581842.72
NULL	NULL	33.0	0.0	0.0	NULL	51	0.0	-4.69581792E8	-23	-469581842.72	0.0
--51.0	false	NULL	1Lh6Uoq3WhNtOqQHu7WN7U	-51	-352637533	1969-12-31 16:00:08.451	0.0	352637506.72
NULL	NULL	33.0	0.0	0.0	NULL	51	0.0	-3.52637472E8	-23	-352637506.72	0.0
--51.0	true	NULL	04Y1mA17	-51	-114647521	1969-12-31 16:00:08.451	0.0	114647494.72	NULL	NULL
33.0	0.0	0.0	NULL	51	0.0	-1.14647472E8	-23	-114647494.72	0.0
--51.0	true	NULL	10Wu570aLPO0p02P17FeH	-51	405338893	1969-12-31 16:00:08.451	0.0	-405338919.28
NULL	NULL	33.0	0.0	0.0	NULL	51	0.0	4.05338944E8	-23	405338919.28	0.0
--51.0	true	NULL	3cQp060	-51	-226923315	1969-12-31 16:00:08.451	0.0	226923288.72	NULL	NULL
33.0	0.0	0.0	NULL	51	0.0	-2.26923264E8	-23	-226923288.72	0.0
--51.0	true	NULL	8EPG0Xi307qd	-51	-328662044	1969-12-31 16:00:08.451	0.0	328662017.72	NULL
NULL	33.0	0.0	0.0	NULL	51	0.0	-3.28661984E8	-23	-328662017.72	0.0
--51.0	true	NULL	8iHtdkJ6d	-51	1006818344	1969-12-31 16:00:08.451	0.0	-1006818370.28	NULL
NULL	33.0	0.0	0.0	NULL	51	0.0	1.00681843E9	-23	1006818370.28	0.0
--51.0	true	NULL	QiOcvR0kt6r7f0R7fiPxQTCU	-51	266531954	1969-12-31 16:00:08.451	0.0	-266531980.28
NULL	NULL	33.0	0.0	0.0	NULL	51	0.0	2.66532E8	-23	266531980.28	0.0
--51.0	true	NULL	Ybpj38RTTYl7CnJXPNx1g4C	-51	-370919370	1969-12-31 16:00:08.451	0.0	370919343.72
NULL	NULL	33.0	0.0	0.0	NULL	51	0.0	-3.70919296E8	-23	-370919343.72	0.0
--6.0	NULL	-200.0	NULL	-6	NULL	1969-12-31 15:59:56.094	0.0	NULL	-200.0	-15910.599999999999
3.0	0.0	0.0	-23.0	6	NULL	NULL	-5	NULL	NULL
--62.0	NULL	15601.0	NULL	-62	NULL	1969-12-31 15:59:56.527	0.0	NULL	15601.0	1241106.353	33.0
0.0	0.0	-23.0	62	NULL	NULL	-23	NULL	NULL
-11.0	false	NULL	10pO8p1LNx4Y	11	271296824	1969-12-31 16:00:02.351	0.0	-271296850.28	NULL
NULL	0.0	0.0	0.0	NULL	-11	0.0	2.71296832E8	-1	271296850.28	0.0
-11.0	false	NULL	1H6wGP	11	-560827082	1969-12-31 16:00:02.351	0.0	560827055.72	NULL	NULL	0.0
0.0	0.0	NULL	-11	0.0	-5.6082707E8	-1	-560827055.72	0.0
-11.0	false	NULL	2a7V63IL7jK3o	11	-325931647	1969-12-31 16:00:02.351	0.0	325931620.72	NULL
NULL	0.0	0.0	0.0	NULL	-11	0.0	-3.25931648E8	-1	-325931620.72	0.0
-11.0	true	NULL	10	11	92365813	1969-12-31 16:00:02.351	0.0	-92365839.28	NULL	NULL	0.0	0.0
0.0	NULL	-11	0.0	9.2365808E7	-1	92365839.28	0.0
-21.0	NULL	15601.0	NULL	21	NULL	1969-12-31 15:59:56.527	0.0	NULL	15601.0	1241106.353	12.0
0.0	0.0	-23.0	-21	NULL	NULL	-2	NULL	NULL
-32.0	NULL	-200.0	NULL	32	NULL	1969-12-31 16:00:02.445	0.0	NULL	-200.0	-15910.599999999999
1.0	0.0	0.0	-23.0	-32	NULL	NULL	-23	NULL	NULL
-36.0	NULL	-200.0	NULL	36	NULL	1969-12-31 16:00:00.554	0.0	NULL	-200.0	-15910.599999999999
33.0	0.0	0.0	-23.0	-36	NULL	NULL	-23	NULL	NULL
-5.0	NULL	15601.0	NULL	5	NULL	1969-12-31 15:59:56.527	0.0	NULL	15601.0	1241106.353	3.0	0.0
0.0	-23.0	-5	NULL	NULL	-3	NULL	NULL
-58.0	NULL	15601.0	NULL	58	NULL	1969-12-31 15:59:56.527	0.0	NULL	15601.0	1241106.353	33.0
0.0	0.0	-23.0	-58	NULL	NULL	-23	NULL	NULL
-8.0	false	NULL	10V3pN5r5lI2qWl2lG103	8	-362835731	1969-12-31 16:00:15.892	0.0	362835704.72
NULL	NULL	1.0	0.0	0.0	NULL	-8	0.0	-3.62835744E8	-7	-362835704.72	0.0
-8.0	false	NULL	10c4qt584m5y6uWT	8	-183000142	1969-12-31 16:00:15.892	0.0	183000115.72	NULL
NULL	1.0	0.0	0.0	NULL	-8	0.0	-1.8300016E8	-7	-183000115.72	0.0
-8.0	false	NULL	8GloEukQ0c68JDmnYL53	8	-722873402	1969-12-31 16:00:15.892	0.0	722873375.72
NULL	NULL	1.0	0.0	0.0	NULL	-8	0.0	-7.2287341E8	-7	-722873375.72	0.0
-8.0	false	NULL	kA0XH5C5	8	-503903864	1969-12-31 16:00:15.892	0.0	503903837.72	NULL	NULL	1.0
0.0	0.0	NULL	-8	0.0	-5.03903872E8	-7	-503903837.72	0.0
-8.0	true	NULL	100VTM7PEW8GH1uE	8	88129338	1969-12-31 16:00:15.892	0.0	-88129364.28	NULL	NULL
1.0	0.0	0.0	NULL	-8	0.0	8.8129328E7	-7	88129364.28	0.0
-8.0	true	NULL	1062158y	8	-1005155523	1969-12-31 16:00:15.892	0.0	1005155496.72	NULL	NULL
1.0	0.0	0.0	NULL	-8	0.0	-1.00515552E9	-7	-1005155496.72	0.0
-8.0	true	NULL	1063cEnGjSal	8	-624769630	1969-12-31 16:00:15.892	0.0	624769603.72	NULL	NULL
1.0	0.0	0.0	NULL	-8	0.0	-6.247696E8	-7	-624769603.72	0.0
-8.0	true	NULL	4kMasVoB7lX1wc5i64bNk	8	683567667	1969-12-31 16:00:15.892	0.0	-683567693.28
NULL	NULL	1.0	0.0	0.0	NULL	-8	0.0	6.8356768E8	-7	683567693.28	0.0
-8.0	true	NULL	XH6I7A417	8	436627202	1969-12-31 16:00:15.892	0.0	-436627228.28	NULL	NULL	1.0
0.0	0.0	NULL	-8	0.0	4.366272E8	-7	436627228.28	0.0
-NULL	false	-13008.0	10	NULL	-896629175	NULL	NULL	896629148.72	-13008.0	-1034825.424	NULL
NULL	NULL	-23.0	NULL	0.0	NULL	NULL	-896629148.72	0.0
-NULL	false	-7707.0	10vke853	NULL	424959354	NULL	NULL	-424959380.28	-7707.0	-613114.971	NULL
NULL	NULL	-23.0	NULL	0.0	NULL	NULL	424959380.28	0.0
-NULL	false	14771.0	10	NULL	993788576	NULL	NULL	-993788602.28	14771.0	1175077.363	NULL	NULL
NULL	-23.0	NULL	0.0	NULL	NULL	993788602.28	0.0
-NULL	false	2459.0	10	NULL	-394064473	NULL	NULL	394064446.72	2459.0	195620.827	NULL	NULL	NULL
-23.0	NULL	0.0	NULL	NULL	-394064446.72	0.0
-NULL	true	-14640.0	101n6n461o	NULL	-819657767	NULL	NULL	819657740.72	-14640.0	-1164655.92
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	-819657740.72	0.0
-NULL	true	-14674.0	105aFDAt30c4rI4U	NULL	-831072496	NULL	NULL	831072469.72	-14674.0	-1167360.722
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	-831072469.72	0.0
-NULL	true	-7238.0	10ljXCFT6fG6Qi3S7414e	NULL	-256767096	NULL	NULL	256767069.72	-7238.0	-575804.614
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	-256767069.72	0.0
-NULL	true	-9489.0	10Yr6	NULL	500274721	NULL	NULL	-500274747.28	-9489.0	-754878.417	NULL	NULL
NULL	-23.0	NULL	0.0	NULL	NULL	500274747.28	0.0
-NULL	true	10419.0	10	NULL	-721614386	NULL	NULL	721614359.72	10419.0	828862.7069999999	NULL
NULL	NULL	-23.0	NULL	0.0	NULL	NULL	-721614359.72	0.0
-NULL	true	14519.0	100xJdkyc	NULL	729277608	NULL	NULL	-729277634.28	14519.0	1155030.007	NULL
NULL	NULL	-23.0	NULL	0.0	NULL	NULL	729277634.28	0.0
-NULL	true	2261.0	10Hr5oB07Ohu0622u	NULL	612000160	NULL	NULL	-612000186.28	2261.0	179869.33299999998
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	612000186.28	0.0
-NULL	true	4516.0	10lL0XD6WP2x64f70N0fHmC1	NULL	-974538365	NULL	NULL	974538338.72	4516.0	359261.348
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	-974538338.72	0.0
-NULL	true	4767.0	10dUdwyXp5XwgpkTxLffmv3x	NULL	187503456	NULL	NULL	-187503482.28	4767.0	379229.151
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	187503482.28	0.0
-NULL	true	5658.0	10M3eGUsKVonbl70DyoCk25	NULL	486382507	NULL	NULL	-486382533.28	5658.0	450110.874
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	486382533.28	0.0
-NULL	true	8659.0	1047piRsT3c3r134I	NULL	487236176	NULL	NULL	-487236202.28	8659.0	688849.427
NULL	NULL	NULL	-23.0	NULL	0.0	NULL	NULL	487236202.28	0.0
+-48.0	NULL	-7196.0	NULL	-48	NULL	1969-12-31 16:00:06.337	NULL	NULL	-7196.0	-572463.388	33.0
NULL	0.0	-23.0	48	NULL	NULL	-23	NULL	NULL
+-51.0	NULL	-200.0	NULL	-51	NULL	1969-12-31 15:59:55.423	NULL	NULL	-200.0	-15910.599999999999
33.0	NULL	0.0	-23.0	51	NULL	NULL	-23	NULL	NULL
+-51.0	false	NULL	10	-51	1058319346	1969-12-31 16:00:08.451	NULL	-1058319372.28	NULL	NULL
33.0	NULL	0.0	NULL	51	NULL	1.05831942E9	-23	1058319372.28	0.0
+-51.0	false	NULL	10TYIE5S35U6dj3N	-51	-469581869	1969-12-31 16:00:08.451	NULL	469581842.72
NULL	NULL	33.0	NULL	0.0	NULL	51	NULL	-4.69581792E8	-23	-469581842.72	0.0
+-51.0	false	NULL	1Lh6Uoq3WhNtOqQHu7WN7U	-51	-352637533	1969-12-31 16:00:08.451	NULL	352637506.72
NULL	NULL	33.0	NULL	0.0	NULL	51	NULL	-3.52637472E8	-23	-352637506.72	0.0
+-51.0	true	NULL	04Y1mA17	-51	-114647521	1969-12-31 16:00:08.451	NULL	114647494.72	NULL	NULL
33.0	NULL	0.0	NULL	51	NULL	-1.14647472E8	-23	-114647494.72	0.0
+-51.0	true	NULL	10Wu570aLPO0p02P17FeH	-51	405338893	1969-12-31 16:00:08.451	NULL	-405338919.28
NULL	NULL	33.0	NULL	0.0	NULL	51	NULL	4.05338944E8	-23	405338919.28	0.0
+-51.0	true	NULL	3cQp060	-51	-226923315	1969-12-31 16:00:08.451	NULL	226923288.72	NULL	NULL
33.0	NULL	0.0	NULL	51	NULL	-2.26923264E8	-23	-226923288.72	0.0
+-51.0	true	NULL	8EPG0Xi307qd	-51	-328662044	1969-12-31 16:00:08.451	NULL	328662017.72	NULL
NULL	33.0	NULL	0.0	NULL	51	NULL	-3.28661984E8	-23	-328662017.72	0.0
+-51.0	true	NULL	8iHtdkJ6d	-51	1006818344	1969-12-31 16:00:08.451	NULL	-1006818370.28	NULL
NULL	33.0	NULL	0.0	NULL	51	NULL	1.00681843E9	-23	1006818370.28	0.0
+-51.0	true	NULL	QiOcvR0kt6r7f0R7fiPxQTCU	-51	266531954	1969-12-31 16:00:08.451	NULL	-266531980.28
NULL	NULL	33.0	NULL	0.0	NULL	51	NULL	2.66532E8	-23	266531980.28	0.0
+-51.0	true	NULL	Ybpj38RTTYl7CnJXPNx1g4C	-51	-370919370	1969-12-31 16:00:08.451	NULL	370919343.72
NULL	NULL	33.0	NULL	0.0	NULL	51	NULL	-3.70919296E8	-23	-370919343.72	0.0
+-6.0	NULL	-200.0	NULL	-6	NULL	1969-12-31 15:59:56.094	NULL	NULL	-200.0	-15910.599999999999
3.0	NULL	0.0	-23.0	6	NULL	NULL	-5	NULL	NULL
+-62.0	NULL	15601.0	NULL	-62	NULL	1969-12-31 15:59:56.527	NULL	NULL	15601.0	1241106.353	33.0
NULL	0.0	-23.0	62	NULL	NULL	-23	NULL	NULL
+11.0	false	NULL	10pO8p1LNx4Y	11	271296824	1969-12-31 16:00:02.351	NULL	-271296850.28	NULL
NULL	0.0	NULL	0.0	NULL	-11	NULL	2.71296832E8	-1	271296850.28	0.0
+11.0	false	NULL	1H6wGP	11	-560827082	1969-12-31 16:00:02.351	NULL	560827055.72	NULL	NULL
0.0	NULL	0.0	NULL	-11	NULL	-5.6082707E8	-1	-560827055.72	0.0
+11.0	false	NULL	2a7V63IL7jK3o	11	-325931647	1969-12-31 16:00:02.351	NULL	325931620.72	NULL
NULL	0.0	NULL	0.0	NULL	-11	NULL	-3.25931648E8	-1	-325931620.72	0.0
+11.0	true	NULL	10	11	92365813	1969-12-31 16:00:02.351	NULL	-92365839.28	NULL	NULL	0.0	NULL
0.0	NULL	-11	NULL	9.2365808E7	-1	92365839.28	0.0
+21.0	NULL	15601.0	NULL	21	NULL	1969-12-31 15:59:56.527	NULL	NULL	15601.0	1241106.353	12.0
NULL	0.0	-23.0	-21	NULL	NULL	-2	NULL	NULL
+32.0	NULL	-200.0	NULL	32	NULL	1969-12-31 16:00:02.445	NULL	NULL	-200.0	-15910.599999999999
1.0	NULL	0.0	-23.0	-32	NULL	NULL	-23	NULL	NULL
+36.0	NULL	-200.0	NULL	36	NULL	1969-12-31 16:00:00.554	NULL	NULL	-200.0	-15910.599999999999
33.0	NULL	0.0	-23.0	-36	NULL	NULL	-23	NULL	NULL
+5.0	NULL	15601.0	NULL	5	NULL	1969-12-31 15:59:56.527	NULL	NULL	15601.0	1241106.353	3.0	NULL
0.0	-23.0	-5	NULL	NULL	-3	NULL	NULL
+58.0	NULL	15601.0	NULL	58	NULL	1969-12-31 15:59:56.527	NULL	NULL	15601.0	1241106.353	33.0
NULL	0.0	-23.0	-58	NULL	NULL	-23	NULL	NULL
+8.0	false	NULL	10V3pN5r5lI2qWl2lG103	8	-362835731	1969-12-31 16:00:15.892	NULL	362835704.72
NULL	NULL	1.0	NULL	0.0	NULL	-8	NULL	-3.62835744E8	-7	-362835704.72	0.0
+8.0	false	NULL	10c4qt584m5y6uWT	8	-183000142	1969-12-31 16:00:15.892	NULL	183000115.72	NULL
NULL	1.0	NULL	0.0	NULL	-8	NULL	-1.8300016E8	-7	-183000115.72	0.0
+8.0	false	NULL	8GloEukQ0c68JDmnYL53	8	-722873402	1969-12-31 16:00:15.892	NULL	722873375.72
NULL	NULL	1.0	NULL	0.0	NULL	-8	NULL	-7.2287341E8	-7	-722873375.72	0.0
+8.0	false	NULL	kA0XH5C5	8	-503903864	1969-12-31 16:00:15.892	NULL	503903837.72	NULL	NULL
1.0	NULL	0.0	NULL	-8	NULL	-5.03903872E8	-7	-503903837.72	0.0
+8.0	true	NULL	100VTM7PEW8GH1uE	8	88129338	1969-12-31 16:00:15.892	NULL	-88129364.28	NULL
NULL	1.0	NULL	0.0	NULL	-8	NULL	8.8129328E7	-7	88129364.28	0.0
+8.0	true	NULL	1062158y	8	-1005155523	1969-12-31 16:00:15.892	NULL	1005155496.72	NULL	NULL
1.0	NULL	0.0	NULL	-8	NULL	-1.00515552E9	-7	-1005155496.72	0.0
+8.0	true	NULL	1063cEnGjSal	8	-624769630	1969-12-31 16:00:15.892	NULL	624769603.72	NULL	NULL
1.0	NULL	0.0	NULL	-8	NULL	-6.247696E8	-7	-624769603.72	0.0
+8.0	true	NULL	4kMasVoB7lX1wc5i64bNk	8	683567667	1969-12-31 16:00:15.892	NULL	-683567693.28
NULL	NULL	1.0	NULL	0.0	NULL	-8	NULL	6.8356768E8	-7	683567693.28	0.0
+8.0	true	NULL	XH6I7A417	8	436627202	1969-12-31 16:00:15.892	NULL	-436627228.28	NULL	NULL
1.0	NULL	0.0	NULL	-8	NULL	4.366272E8	-7	436627228.28	0.0
+NULL	false	-13008.0	10	NULL	-896629175	NULL	NULL	896629148.72	-13008.0	-1034825.424	NULL
NULL	NULL	-23.0	NULL	NULL	NULL	NULL	-896629148.72	0.0
+NULL	false	-7707.0	10vke853	NULL	424959354	NULL	NULL	-424959380.28	-7707.0	-613114.971	NULL
NULL	NULL	-23.0	NULL	NULL	NULL	NULL	424959380.28	0.0
+NULL	false	14771.0	10	NULL	993788576	NULL	NULL	-993788602.28	14771.0	1175077.363	NULL	NULL
NULL	-23.0	NULL	NULL	NULL	NULL	993788602.28	0.0
+NULL	false	2459.0	10	NULL	-394064473	NULL	NULL	394064446.72	2459.0	195620.827	NULL	NULL	NULL
-23.0	NULL	NULL	NULL	NULL	-394064446.72	0.0
+NULL	true	-14640.0	101n6n461o	NULL	-819657767	NULL	NULL	819657740.72	-14640.0	-1164655.92
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	-819657740.72	0.0
+NULL	true	-14674.0	105aFDAt30c4rI4U	NULL	-831072496	NULL	NULL	831072469.72	-14674.0	-1167360.722
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	-831072469.72	0.0
+NULL	true	-7238.0	10ljXCFT6fG6Qi3S7414e	NULL	-256767096	NULL	NULL	256767069.72	-7238.0	-575804.614
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	-256767069.72	0.0
+NULL	true	-9489.0	10Yr6	NULL	500274721	NULL	NULL	-500274747.28	-9489.0	-754878.417	NULL	NULL
NULL	-23.0	NULL	NULL	NULL	NULL	500274747.28	0.0
+NULL	true	10419.0	10	NULL	-721614386	NULL	NULL	721614359.72	10419.0	828862.7069999999	NULL
NULL	NULL	-23.0	NULL	NULL	NULL	NULL	-721614359.72	0.0
+NULL	true	14519.0	100xJdkyc	NULL	729277608	NULL	NULL	-729277634.28	14519.0	1155030.007	NULL
NULL	NULL	-23.0	NULL	NULL	NULL	NULL	729277634.28	0.0
+NULL	true	2261.0	10Hr5oB07Ohu0622u	NULL	612000160	NULL	NULL	-612000186.28	2261.0	179869.33299999998
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	612000186.28	0.0
+NULL	true	4516.0	10lL0XD6WP2x64f70N0fHmC1	NULL	-974538365	NULL	NULL	974538338.72	4516.0	359261.348
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	-974538338.72	0.0
+NULL	true	4767.0	10dUdwyXp5XwgpkTxLffmv3x	NULL	187503456	NULL	NULL	-187503482.28	4767.0	379229.151
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	187503482.28	0.0
+NULL	true	5658.0	10M3eGUsKVonbl70DyoCk25	NULL	486382507	NULL	NULL	-486382533.28	5658.0	450110.874
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	486382533.28	0.0
+NULL	true	8659.0	1047piRsT3c3r134I	NULL	487236176	NULL	NULL	-487236202.28	8659.0	688849.427
NULL	NULL	NULL	-23.0	NULL	NULL	NULL	NULL	487236202.28	0.0

http://git-wip-us.apache.org/repos/asf/hive/blob/dd04a92f/ql/src/test/results/clientpositive/udf_stddev_samp.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/udf_stddev_samp.q.out b/ql/src/test/results/clientpositive/udf_stddev_samp.q.out
index c6b7adf..674de04 100644
--- a/ql/src/test/results/clientpositive/udf_stddev_samp.q.out
+++ b/ql/src/test/results/clientpositive/udf_stddev_samp.q.out
@@ -2,23 +2,81 @@ PREHOOK: query: DESCRIBE FUNCTION stddev_samp
 PREHOOK: type: DESCFUNCTION
 POSTHOOK: query: DESCRIBE FUNCTION stddev_samp
 POSTHOOK: type: DESCFUNCTION
-stddev_samp(x) - Returns the sample standard deviation of a set of numbers
+stddev_samp(x) - Returns the sample standard deviation of a set of numbers.
+If applied to an empty set: NULL is returned.
+If applied to a set with a single element: NULL is returned.
+Otherwise it computes: sqrt(var_samp(x))
 PREHOOK: query: DESCRIBE FUNCTION EXTENDED stddev_samp
 PREHOOK: type: DESCFUNCTION
 POSTHOOK: query: DESCRIBE FUNCTION EXTENDED stddev_samp
 POSTHOOK: type: DESCFUNCTION
-stddev_samp(x) - Returns the sample standard deviation of a set of numbers
+stddev_samp(x) - Returns the sample standard deviation of a set of numbers.
+If applied to an empty set: NULL is returned.
+If applied to a set with a single element: NULL is returned.
+Otherwise it computes: sqrt(var_samp(x))
 Function class:org.apache.hadoop.hive.ql.udf.generic.GenericUDAFStdSample
 Function type:BUILTIN
 PREHOOK: query: DESCRIBE FUNCTION stddev_samp
 PREHOOK: type: DESCFUNCTION
 POSTHOOK: query: DESCRIBE FUNCTION stddev_samp
 POSTHOOK: type: DESCFUNCTION
-stddev_samp(x) - Returns the sample standard deviation of a set of numbers
+stddev_samp(x) - Returns the sample standard deviation of a set of numbers.
+If applied to an empty set: NULL is returned.
+If applied to a set with a single element: NULL is returned.
+Otherwise it computes: sqrt(var_samp(x))
 PREHOOK: query: DESCRIBE FUNCTION EXTENDED stddev_samp
 PREHOOK: type: DESCFUNCTION
 POSTHOOK: query: DESCRIBE FUNCTION EXTENDED stddev_samp
 POSTHOOK: type: DESCFUNCTION
-stddev_samp(x) - Returns the sample standard deviation of a set of numbers
+stddev_samp(x) - Returns the sample standard deviation of a set of numbers.
+If applied to an empty set: NULL is returned.
+If applied to a set with a single element: NULL is returned.
+Otherwise it computes: sqrt(var_samp(x))
 Function class:org.apache.hadoop.hive.ql.udf.generic.GenericUDAFStdSample
 Function type:BUILTIN
+PREHOOK: query: drop table if exists t
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table if exists t
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table t (a int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@t
+POSTHOOK: query: create table t (a int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@t
+PREHOOK: query: insert into t values (1),(-1),(0)
+PREHOOK: type: QUERY
+PREHOOK: Output: default@t
+POSTHOOK: query: insert into t values (1),(-1),(0)
+POSTHOOK: type: QUERY
+POSTHOOK: Output: default@t
+POSTHOOK: Lineage: t.a EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1,
type:string, comment:), ]
+PREHOOK: query: select stddev_samp(a) from t
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t
+#### A masked pattern was here ####
+POSTHOOK: query: select stddev_samp(a) from t
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t
+#### A masked pattern was here ####
+1.0
+PREHOOK: query: select stddev_samp(a) from t where a=0
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t
+#### A masked pattern was here ####
+POSTHOOK: query: select stddev_samp(a) from t where a=0
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t
+#### A masked pattern was here ####
+NULL
+PREHOOK: query: select round(stddev_samp(a),5) from t where a>=0
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t
+#### A masked pattern was here ####
+POSTHOOK: query: select round(stddev_samp(a),5) from t where a>=0
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t
+#### A masked pattern was here ####
+0.70711

http://git-wip-us.apache.org/repos/asf/hive/blob/dd04a92f/ql/src/test/results/clientpositive/udf_var_samp.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/udf_var_samp.q.out b/ql/src/test/results/clientpositive/udf_var_samp.q.out
index 4a5c9b4..c1d23d0 100644
--- a/ql/src/test/results/clientpositive/udf_var_samp.q.out
+++ b/ql/src/test/results/clientpositive/udf_var_samp.q.out
@@ -2,23 +2,81 @@ PREHOOK: query: DESCRIBE FUNCTION var_samp
 PREHOOK: type: DESCFUNCTION
 POSTHOOK: query: DESCRIBE FUNCTION var_samp
 POSTHOOK: type: DESCFUNCTION
-var_samp(x) - Returns the sample variance of a set of numbers
+var_samp(x) - Returns the sample variance of a set of numbers.
+If applied to an empty set: NULL is returned.
+If applied to a set with a single element: NULL is returned.
+Otherwise it computes: (S2-S1*S1/N)/(N-1)
 PREHOOK: query: DESCRIBE FUNCTION EXTENDED var_samp
 PREHOOK: type: DESCFUNCTION
 POSTHOOK: query: DESCRIBE FUNCTION EXTENDED var_samp
 POSTHOOK: type: DESCFUNCTION
-var_samp(x) - Returns the sample variance of a set of numbers
+var_samp(x) - Returns the sample variance of a set of numbers.
+If applied to an empty set: NULL is returned.
+If applied to a set with a single element: NULL is returned.
+Otherwise it computes: (S2-S1*S1/N)/(N-1)
 Function class:org.apache.hadoop.hive.ql.udf.generic.GenericUDAFVarianceSample
 Function type:BUILTIN
 PREHOOK: query: DESCRIBE FUNCTION var_samp
 PREHOOK: type: DESCFUNCTION
 POSTHOOK: query: DESCRIBE FUNCTION var_samp
 POSTHOOK: type: DESCFUNCTION
-var_samp(x) - Returns the sample variance of a set of numbers
+var_samp(x) - Returns the sample variance of a set of numbers.
+If applied to an empty set: NULL is returned.
+If applied to a set with a single element: NULL is returned.
+Otherwise it computes: (S2-S1*S1/N)/(N-1)
 PREHOOK: query: DESCRIBE FUNCTION EXTENDED var_samp
 PREHOOK: type: DESCFUNCTION
 POSTHOOK: query: DESCRIBE FUNCTION EXTENDED var_samp
 POSTHOOK: type: DESCFUNCTION
-var_samp(x) - Returns the sample variance of a set of numbers
+var_samp(x) - Returns the sample variance of a set of numbers.
+If applied to an empty set: NULL is returned.
+If applied to a set with a single element: NULL is returned.
+Otherwise it computes: (S2-S1*S1/N)/(N-1)
 Function class:org.apache.hadoop.hive.ql.udf.generic.GenericUDAFVarianceSample
 Function type:BUILTIN
+PREHOOK: query: drop table if exists t
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table if exists t
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table t (a int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@t
+POSTHOOK: query: create table t (a int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@t
+PREHOOK: query: insert into t values (1),(-1),(0)
+PREHOOK: type: QUERY
+PREHOOK: Output: default@t
+POSTHOOK: query: insert into t values (1),(-1),(0)
+POSTHOOK: type: QUERY
+POSTHOOK: Output: default@t
+POSTHOOK: Lineage: t.a EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1,
type:string, comment:), ]
+PREHOOK: query: select var_samp(a) from t
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t
+#### A masked pattern was here ####
+POSTHOOK: query: select var_samp(a) from t
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t
+#### A masked pattern was here ####
+1.0
+PREHOOK: query: select var_samp(a) from t where a=0
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t
+#### A masked pattern was here ####
+POSTHOOK: query: select var_samp(a) from t where a=0
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t
+#### A masked pattern was here ####
+NULL
+PREHOOK: query: select round(var_samp(a),5) from t where a>=0
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t
+#### A masked pattern was here ####
+POSTHOOK: query: select round(var_samp(a),5) from t where a>=0
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t
+#### A masked pattern was here ####
+0.5


Mime
View raw message