You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jc...@apache.org on 2019/03/07 22:51:38 UTC

[hive] branch branch-3.1 updated: HIVE-21376: Incompatible change in Hive bucket computation (Jesus Camacho Rodriguez, reviewed by Ashutosh Chauhan)

This is an automated email from the ASF dual-hosted git repository.

jcamacho pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 7dc47fa  HIVE-21376: Incompatible change in Hive bucket computation (Jesus Camacho Rodriguez, reviewed by Ashutosh Chauhan)
7dc47fa is described below

commit 7dc47faddba9f079bbe2698aaa4d8712e7654f87
Author: Jesus Camacho Rodriguez <jc...@apache.org>
AuthorDate: Mon Mar 4 09:27:45 2019 -0800

    HIVE-21376: Incompatible change in Hive bucket computation (Jesus Camacho Rodriguez, reviewed by Ashutosh Chauhan)
---
 .../clientpositive/llap/llap_uncompressed.q.out    |   2 +-
 .../results/clientpositive/llap/orc_llap.q.out     |   4 +-
 .../results/clientpositive/llap/orc_ppd_date.q.out |  50 +++++------
 .../clientpositive/llap/orc_ppd_decimal.q.out      | 100 ++++++++++-----------
 .../clientpositive/llap/orc_ppd_timestamp.q.out    |  48 +++++-----
 .../clientpositive/llap/orc_ppd_varchar.q.out      |  32 +++----
 .../llap/vector_binary_join_groupby.q.out          |   2 +-
 .../clientpositive/llap/vector_data_types.q.out    |   4 +-
 .../llap/vector_decimal_expressions.q.out          |   4 +-
 .../test/results/clientpositive/orc_merge12.q.out  |   4 +-
 .../test/results/clientpositive/orc_ppd_char.q.out |  36 ++++----
 .../clientpositive/spark/vector_data_types.q.out   |   4 +-
 .../results/clientpositive/tez/orc_merge12.q.out   |   4 +-
 .../vector_binary_join_groupby.q.out               |   2 +-
 .../results/clientpositive/vector_data_types.q.out |   4 +-
 .../vector_decimal_expressions.q.out               |   4 +-
 .../hadoop/hive/serde2/io/DateWritableV2.java      |   2 +-
 .../objectinspector/ObjectInspectorUtils.java      |   9 +-
 .../objectinspector/TestObjectInspectorUtils.java  |  31 +++++++
 19 files changed, 190 insertions(+), 156 deletions(-)

diff --git a/ql/src/test/results/clientpositive/llap/llap_uncompressed.q.out b/ql/src/test/results/clientpositive/llap/llap_uncompressed.q.out
index 585384a..960caff 100644
--- a/ql/src/test/results/clientpositive/llap/llap_uncompressed.q.out
+++ b/ql/src/test/results/clientpositive/llap/llap_uncompressed.q.out
@@ -166,7 +166,7 @@ POSTHOOK: query: select sum(hash(*)) from llap_temp_table
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@llap_temp_table
 #### A masked pattern was here ####
-251958877792
+212787774304
 PREHOOK: query: explain
 select * from orc_llap_n0 where cint > 10 and cint < 5000000
 PREHOOK: type: QUERY
diff --git a/ql/src/test/results/clientpositive/llap/orc_llap.q.out b/ql/src/test/results/clientpositive/llap/orc_llap.q.out
index 3f641c8..10adbdc 100644
--- a/ql/src/test/results/clientpositive/llap/orc_llap.q.out
+++ b/ql/src/test/results/clientpositive/llap/orc_llap.q.out
@@ -391,7 +391,7 @@ POSTHOOK: query: select sum(hash(*)) from (select * from orc_llap where cint > 1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@orc_llap
 #### A masked pattern was here ####
-258089178813
+-197609091139
 PREHOOK: query: explain
 select sum(hash(*)) from (select cstring2 from orc_llap where cint > 5 and cint < 10) t
 PREHOOK: type: QUERY
@@ -869,7 +869,7 @@ POSTHOOK: query: select sum(hash(*)) from (select * from orc_llap where cint > 1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@orc_llap
 #### A masked pattern was here ####
-516178357626
+-395218182278
 PREHOOK: query: explain
 select sum(hash(*)) from (select cstring2 from orc_llap where cint > 5 and cint < 10) t
 PREHOOK: type: QUERY
diff --git a/ql/src/test/results/clientpositive/llap/orc_ppd_date.q.out b/ql/src/test/results/clientpositive/llap/orc_ppd_date.q.out
index 23d7b08..a3709c4 100644
--- a/ql/src/test/results/clientpositive/llap/orc_ppd_date.q.out
+++ b/ql/src/test/results/clientpositive/llap/orc_ppd_date.q.out
@@ -26,7 +26,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da='1970-02-20'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da='1970-02-20'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -35,7 +35,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da='1970-02-20'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da= date '1970-02-20'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -44,7 +44,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da= date '1970-02
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da=cast('1970-02-20' as date)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -53,7 +53,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da=cast('1970-02-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da=cast('1970-02-20' as date)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -62,7 +62,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da=cast('1970-02-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da=cast('1970-02-20' as varchar(20))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -71,7 +71,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da=cast('1970-02-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da=cast('1970-02-20' as varchar(20))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -80,7 +80,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da=cast('1970-02-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da!='1970-02-20'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -89,7 +89,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da!='1970-02-20'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da!='1970-02-20'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -98,7 +98,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da!='1970-02-20'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<'1970-02-27'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -107,7 +107,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<'1970-02-27'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<'1970-02-27'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -116,7 +116,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<'1970-02-27'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<'1970-02-29'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -125,7 +125,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<'1970-02-29'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<'1970-02-29'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -134,7 +134,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<'1970-02-29'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<'1970-02-15'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -161,7 +161,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<='1970-02-20'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<='1970-02-20'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -170,7 +170,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<='1970-02-20'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<='1970-02-27'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -179,7 +179,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<='1970-02-27'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<='1970-02-27'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -188,7 +188,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da<='1970-02-27'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da in (cast('1970-02-21' as date), cast('1970-02-27' as date))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -197,7 +197,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da in (cast('1970
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da in (cast('1970-02-21' as date), cast('1970-02-27' as date))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -206,7 +206,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da in (cast('1970
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da in (cast('1970-02-20' as date), cast('1970-02-27' as date))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -215,7 +215,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da in (cast('1970
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da in (cast('1970-02-20' as date), cast('1970-02-27' as date))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -224,7 +224,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da in (cast('1970
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da in (cast('1970-02-21' as date), cast('1970-02-22' as date))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -251,7 +251,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da between '1970-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da between '1970-02-19' and '1970-02-22'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -260,7 +260,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da between '1970-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da between '1970-02-19' and '1970-02-28'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -269,7 +269,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da between '1970-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da between '1970-02-19' and '1970-02-28'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
@@ -278,7 +278,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da between '1970-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n3
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n3 where da between '1970-02-18' and '1970-02-19'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n3
diff --git a/ql/src/test/results/clientpositive/llap/orc_ppd_decimal.q.out b/ql/src/test/results/clientpositive/llap/orc_ppd_decimal.q.out
index 4b535d4..15f52ec 100644
--- a/ql/src/test/results/clientpositive/llap/orc_ppd_decimal.q.out
+++ b/ql/src/test/results/clientpositive/llap/orc_ppd_decimal.q.out
@@ -26,7 +26,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d=0.22
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d=0.22
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -35,7 +35,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d=0.22
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d='0.22'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -44,7 +44,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d='0.22'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d='0.22'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -53,7 +53,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d='0.22'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d=cast('0.22' as float)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -62,7 +62,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d=cast('0.22' as
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d=cast('0.22' as float)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -71,7 +71,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d=cast('0.22' as
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d!=0.22
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -80,7 +80,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d!=0.22
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d!=0.22
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -89,7 +89,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d!=0.22
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d!='0.22'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -98,7 +98,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d!='0.22'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d!='0.22'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -107,7 +107,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d!='0.22'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d!=cast('0.22' as float)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -116,7 +116,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d!=cast('0.22' as
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d!=cast('0.22' as float)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -125,7 +125,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d!=cast('0.22' as
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<11.22
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -134,7 +134,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<11.22
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<11.22
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -143,7 +143,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<11.22
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<'11.22'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -152,7 +152,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<'11.22'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<'11.22'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -161,7 +161,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<'11.22'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<cast('11.22' as float)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -170,7 +170,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<cast('11.22' as
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<cast('11.22' as float)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -179,7 +179,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<cast('11.22' as
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -188,7 +188,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -197,7 +197,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=11.22
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -206,7 +206,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=11.22
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=11.22
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -215,7 +215,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=11.22
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<='11.22'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -224,7 +224,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<='11.22'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<='11.22'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -233,7 +233,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<='11.22'
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=cast('11.22' as float)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -242,7 +242,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=cast('11.22' a
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=cast('11.22' as float)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -251,7 +251,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=cast('11.22' a
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=cast('11.22' as decimal)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -260,7 +260,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=cast('11.22' a
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=cast('11.22' as decimal)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -269,7 +269,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=cast('11.22' a
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=11.22BD
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -278,7 +278,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=11.22BD
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=11.22BD
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -287,7 +287,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=11.22BD
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=12
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -296,7 +296,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=12
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=12
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -305,7 +305,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d<=12
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.22', '1.0')
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -314,7 +314,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.22', '1.
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.22', '1.0')
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -323,7 +323,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.22', '1.
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.22', '11.22')
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -332,7 +332,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.22', '11
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.22', '11.22')
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -341,7 +341,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.22', '11
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.9', '1.0')
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -368,7 +368,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.9', 0.22
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.9', 0.22)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -377,7 +377,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.9', 0.22
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.9', 0.22, cast('11.22' as float))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -386,7 +386,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.9', 0.22
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.9', 0.22, cast('11.22' as float))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -395,7 +395,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d in ('0.9', 0.22
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and 1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -404,7 +404,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and 1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and 1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -413,7 +413,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and 1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and 1000
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -422,7 +422,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and 1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and 1000
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -431,7 +431,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and 1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and '2.0'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -440,7 +440,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and '
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and '2.0'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -449,7 +449,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and '
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and cast(3 as float)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -458,7 +458,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and cast(3 as float)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -467,7 +467,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 0 and c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 1 and cast(30 as char(10))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -476,7 +476,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 1 and c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 1 and cast(30 as char(10))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n5
@@ -485,4 +485,4 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n5 where d between 1 and c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n5
 #### A masked pattern was here ####
-336445133500
+334427804500
diff --git a/ql/src/test/results/clientpositive/llap/orc_ppd_timestamp.q.out b/ql/src/test/results/clientpositive/llap/orc_ppd_timestamp.q.out
index bfaf50e..29fad31 100644
--- a/ql/src/test/results/clientpositive/llap/orc_ppd_timestamp.q.out
+++ b/ql/src/test/results/clientpositive/llap/orc_ppd_timestamp.q.out
@@ -26,7 +26,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where cast(ts as string
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-445649415500
+445653015500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where cast(ts as string)='2011-01-01 01:01:01'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -35,7 +35,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where cast(ts as string
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-445649415500
+445653015500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts=cast('2011-01-01 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -44,7 +44,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts=cast('2011-01-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-445649415500
+445653015500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts=cast('2011-01-01 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -53,7 +53,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts=cast('2011-01-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-445649415500
+445653015500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts=cast('2011-01-01 01:01:01' as varchar(20))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -62,7 +62,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts=cast('2011-01-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-445649415500
+445653015500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts=cast('2011-01-01 01:01:01' as varchar(20))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -71,7 +71,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts=cast('2011-01-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-445649415500
+445653015500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts!=cast('2011-01-01 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -80,7 +80,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts!=cast('2011-01
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-1033234345500
+1033237945500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts!=cast('2011-01-01 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -89,7 +89,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts!=cast('2011-01
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-1033234345500
+1033237945500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<cast('2011-01-20 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -98,7 +98,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<cast('2011-01-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-445649415500
+445653015500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<cast('2011-01-20 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -107,7 +107,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<cast('2011-01-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-445649415500
+445653015500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<cast('2011-01-22 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -116,7 +116,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<cast('2011-01-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-1478883761000
+1478890961000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<cast('2011-01-22 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -125,7 +125,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<cast('2011-01-
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-1478883761000
+1478890961000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<cast('2010-10-01 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -152,7 +152,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<=cast('2011-01
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-445649415500
+445653015500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<=cast('2011-01-01 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -161,7 +161,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<=cast('2011-01
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-445649415500
+445653015500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<=cast('2011-01-20 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -170,7 +170,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<=cast('2011-01
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-1478883761000
+1478890961000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<=cast('2011-01-20 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -179,7 +179,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts<=cast('2011-01
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-1478883761000
+1478890961000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts in (cast('2011-01-02 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -188,7 +188,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts in (cast('2011
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-1033234345500
+1033237945500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts in (cast('2011-01-02 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -197,7 +197,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts in (cast('2011
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-1033234345500
+1033237945500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -206,7 +206,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts in (cast('2011
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-1478883761000
+1478890961000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts in (cast('2011-01-01 01:01:01' as timestamp), cast('2011-01-20 01:01:01' as timestamp))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -215,7 +215,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts in (cast('2011
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-1478883761000
+1478890961000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts in (cast('2011-01-02 01:01:01' as timestamp), cast('2011-01-08 01:01:01' as timestamp))
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -242,7 +242,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts between cast('
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-445649415500
+445653015500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-08 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -251,7 +251,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts between cast('
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-445649415500
+445653015500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -260,7 +260,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts between cast('
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-1478883761000
+1478890961000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2011-01-25 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
@@ -269,7 +269,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts between cast('
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n2
 #### A masked pattern was here ####
-1478883761000
+1478890961000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n2 where ts between cast('2010-10-01 01:01:01' as timestamp) and cast('2010-11-01 01:01:01' as timestamp)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n2
diff --git a/ql/src/test/results/clientpositive/llap/orc_ppd_varchar.q.out b/ql/src/test/results/clientpositive/llap/orc_ppd_varchar.q.out
index 897d33f..12d6f67 100644
--- a/ql/src/test/results/clientpositive/llap/orc_ppd_varchar.q.out
+++ b/ql/src/test/results/clientpositive/llap/orc_ppd_varchar.q.out
@@ -26,7 +26,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v="bee"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v="bee"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -35,7 +35,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v="bee"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v!="bee"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -44,7 +44,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v!="bee"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v!="bee"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -53,7 +53,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v!="bee"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v<"world"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -62,7 +62,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v<"world"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v<"world"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -71,7 +71,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v<"world"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v<="world"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -80,7 +80,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v<="world"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v<="world"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -89,7 +89,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v<="world"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v="bee   "
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -116,7 +116,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v in ("bee", "ora
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v in ("bee", "orange")
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -125,7 +125,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v in ("bee", "ora
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v in ("bee", "world")
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -134,7 +134,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v in ("bee", "wor
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v in ("bee", "world")
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -143,7 +143,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v in ("bee", "wor
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v in ("orange")
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -170,7 +170,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v between "bee" a
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v between "bee" and "orange"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -179,7 +179,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v between "bee" a
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v between "bee" and "zombie"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -188,7 +188,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v between "bee" a
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v between "bee" and "zombie"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
@@ -197,7 +197,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v between "bee" a
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n1
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n1 where v between "orange" and "pine"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n1
diff --git a/ql/src/test/results/clientpositive/llap/vector_binary_join_groupby.q.out b/ql/src/test/results/clientpositive/llap/vector_binary_join_groupby.q.out
index 0e0c60c..675ddb0 100644
--- a/ql/src/test/results/clientpositive/llap/vector_binary_join_groupby.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_binary_join_groupby.q.out
@@ -322,7 +322,7 @@ order by k
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@hundredorc
 #### A masked pattern was here ####
--8303557760
+-27832781952
 PREHOOK: query: EXPLAIN VECTORIZATION EXPRESSION
 SELECT count(*), bin
 FROM hundredorc
diff --git a/ql/src/test/results/clientpositive/llap/vector_data_types.q.out b/ql/src/test/results/clientpositive/llap/vector_data_types.q.out
index 75130c7..8a764a8 100644
--- a/ql/src/test/results/clientpositive/llap/vector_data_types.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_data_types.q.out
@@ -213,7 +213,7 @@ FROM (SELECT t, si, i, b, f, d, bo, s, ts, `dec`, bin FROM over1korc_n1 ORDER BY
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@over1korc_n1
 #### A masked pattern was here ####
--25838728092
+-17045922556
 PREHOOK: query: EXPLAIN VECTORIZATION EXPRESSION select t, si, i, b, f, d, bo, s, ts, `dec`, bin FROM over1korc_n1 ORDER BY t, si, i LIMIT 20
 PREHOOK: type: QUERY
 PREHOOK: Input: default@over1korc_n1
@@ -465,4 +465,4 @@ FROM (SELECT t, si, i, b, f, d, bo, s, ts, `dec`, bin FROM over1korc_n1 ORDER BY
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@over1korc_n1
 #### A masked pattern was here ####
--25838728092
+-17045922556
diff --git a/ql/src/test/results/clientpositive/llap/vector_decimal_expressions.q.out b/ql/src/test/results/clientpositive/llap/vector_decimal_expressions.q.out
index 791c57f..e1e63a2 100644
--- a/ql/src/test/results/clientpositive/llap/vector_decimal_expressions.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_decimal_expressions.q.out
@@ -191,7 +191,7 @@ ORDER BY c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14) q
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@decimal_test_n1
 #### A masked pattern was here ####
--1300490595129
+-1300500065817
 PREHOOK: query: CREATE TABLE decimal_test_small_n0 STORED AS ORC AS SELECT cdouble, CAST (((cdouble*22.1)/37) AS DECIMAL(10,3)) AS cdecimal1, CAST (((cdouble*9.3)/13) AS DECIMAL(7,2)) AS cdecimal2 FROM alltypesorc
 PREHOOK: type: CREATETABLE_AS_SELECT
 PREHOOK: Input: default@alltypesorc
@@ -368,4 +368,4 @@ ORDER BY c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14) q
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@decimal_test_small_n0
 #### A masked pattern was here ####
-1273824888155
+1273832202747
diff --git a/ql/src/test/results/clientpositive/orc_merge12.q.out b/ql/src/test/results/clientpositive/orc_merge12.q.out
index 045ba42..fba3c94 100644
--- a/ql/src/test/results/clientpositive/orc_merge12.q.out
+++ b/ql/src/test/results/clientpositive/orc_merge12.q.out
@@ -111,7 +111,7 @@ POSTHOOK: query: select sum(hash(*)) from alltypesorc3xcols
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@alltypesorc3xcols
 #### A masked pattern was here ####
--73477136966
+-301360627590
 PREHOOK: query: alter table alltypesorc3xcols concatenate
 PREHOOK: type: ALTER_TABLE_MERGE
 PREHOOK: Input: default@alltypesorc3xcols
@@ -137,7 +137,7 @@ POSTHOOK: query: select sum(hash(*)) from alltypesorc3xcols
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@alltypesorc3xcols
 #### A masked pattern was here ####
--73477136966
+-301360627590
 PREHOOK: query: select * from alltypesorc3xcols limit 1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@alltypesorc3xcols
diff --git a/ql/src/test/results/clientpositive/orc_ppd_char.q.out b/ql/src/test/results/clientpositive/orc_ppd_char.q.out
index 95766b0..846de53 100644
--- a/ql/src/test/results/clientpositive/orc_ppd_char.q.out
+++ b/ql/src/test/results/clientpositive/orc_ppd_char.q.out
@@ -26,7 +26,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c="apple"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c="apple"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -35,7 +35,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c="apple"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c!="apple"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -44,7 +44,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c!="apple"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c!="apple"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -53,7 +53,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c!="apple"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
-336445133500
+334427804500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c<"hello"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -62,7 +62,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c<"hello"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c<"hello"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -71,7 +71,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c<"hello"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c<="hello"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -80,7 +80,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c<="hello"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c<="hello"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -89,7 +89,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c<="hello"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c="apple "
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -98,7 +98,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c="apple "
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c="apple "
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -107,7 +107,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c="apple "
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c in ("apple", "carrot")
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -116,7 +116,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c in ("apple", "c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c in ("apple", "carrot")
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -125,7 +125,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c in ("apple", "c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c in ("apple", "hello")
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -134,7 +134,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c in ("apple", "h
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c in ("apple", "hello")
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -143,7 +143,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c in ("apple", "h
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c in ("carrot")
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -170,7 +170,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c between "apple"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c between "apple" and "carrot"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -179,7 +179,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c between "apple"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
--250934600000
+-252951929000
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c between "apple" and "zombie"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -188,7 +188,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c between "apple"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c between "apple" and "zombie"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
@@ -197,7 +197,7 @@ POSTHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c between "apple"
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@newtypesorc_n4
 #### A masked pattern was here ####
-85510533500
+81475875500
 PREHOOK: query: select sum(hash(*)) from newtypesorc_n4 where c between "carrot" and "carrot1"
 PREHOOK: type: QUERY
 PREHOOK: Input: default@newtypesorc_n4
diff --git a/ql/src/test/results/clientpositive/spark/vector_data_types.q.out b/ql/src/test/results/clientpositive/spark/vector_data_types.q.out
index f6f5803..112c2bc 100644
--- a/ql/src/test/results/clientpositive/spark/vector_data_types.q.out
+++ b/ql/src/test/results/clientpositive/spark/vector_data_types.q.out
@@ -209,7 +209,7 @@ FROM (SELECT t, si, i, b, f, d, bo, s, ts, `dec`, bin FROM over1korc_n1 ORDER BY
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@over1korc_n1
 #### A masked pattern was here ####
--25838728092
+-17045922556
 PREHOOK: query: EXPLAIN VECTORIZATION EXPRESSION select t, si, i, b, f, d, bo, s, ts, `dec`, bin FROM over1korc_n1 ORDER BY t, si, i LIMIT 20
 PREHOOK: type: QUERY
 PREHOOK: Input: default@over1korc_n1
@@ -457,4 +457,4 @@ FROM (SELECT t, si, i, b, f, d, bo, s, ts, `dec`, bin FROM over1korc_n1 ORDER BY
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@over1korc_n1
 #### A masked pattern was here ####
--25838728092
+-17045922556
diff --git a/ql/src/test/results/clientpositive/tez/orc_merge12.q.out b/ql/src/test/results/clientpositive/tez/orc_merge12.q.out
index acb2fb9..567cdaa 100644
--- a/ql/src/test/results/clientpositive/tez/orc_merge12.q.out
+++ b/ql/src/test/results/clientpositive/tez/orc_merge12.q.out
@@ -111,7 +111,7 @@ POSTHOOK: query: select sum(hash(*)) from alltypesorc3xcols
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@alltypesorc3xcols
 POSTHOOK: Output: hdfs://### HDFS PATH ###
--73477136966
+-301360627590
 PREHOOK: query: alter table alltypesorc3xcols concatenate
 PREHOOK: type: ALTER_TABLE_MERGE
 PREHOOK: Input: default@alltypesorc3xcols
@@ -137,7 +137,7 @@ POSTHOOK: query: select sum(hash(*)) from alltypesorc3xcols
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@alltypesorc3xcols
 POSTHOOK: Output: hdfs://### HDFS PATH ###
--73477136966
+-301360627590
 PREHOOK: query: select * from alltypesorc3xcols limit 1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@alltypesorc3xcols
diff --git a/ql/src/test/results/clientpositive/vector_binary_join_groupby.q.out b/ql/src/test/results/clientpositive/vector_binary_join_groupby.q.out
index 5f5ee49..dbd17d9 100644
--- a/ql/src/test/results/clientpositive/vector_binary_join_groupby.q.out
+++ b/ql/src/test/results/clientpositive/vector_binary_join_groupby.q.out
@@ -300,7 +300,7 @@ order by k
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@hundredorc
 #### A masked pattern was here ####
--8303557760
+-27832781952
 PREHOOK: query: EXPLAIN VECTORIZATION EXPRESSION
 SELECT count(*), bin
 FROM hundredorc
diff --git a/ql/src/test/results/clientpositive/vector_data_types.q.out b/ql/src/test/results/clientpositive/vector_data_types.q.out
index c92b99d..cd954c7 100644
--- a/ql/src/test/results/clientpositive/vector_data_types.q.out
+++ b/ql/src/test/results/clientpositive/vector_data_types.q.out
@@ -203,7 +203,7 @@ FROM (SELECT t, si, i, b, f, d, bo, s, ts, `dec`, bin FROM over1korc_n1 ORDER BY
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@over1korc_n1
 #### A masked pattern was here ####
--25838728092
+-17045922556
 PREHOOK: query: EXPLAIN VECTORIZATION EXPRESSION select t, si, i, b, f, d, bo, s, ts, `dec`, bin FROM over1korc_n1 ORDER BY t, si, i LIMIT 20
 PREHOOK: type: QUERY
 PREHOOK: Input: default@over1korc_n1
@@ -415,4 +415,4 @@ FROM (SELECT t, si, i, b, f, d, bo, s, ts, `dec`, bin FROM over1korc_n1 ORDER BY
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@over1korc_n1
 #### A masked pattern was here ####
--25838728092
+-17045922556
diff --git a/ql/src/test/results/clientpositive/vector_decimal_expressions.q.out b/ql/src/test/results/clientpositive/vector_decimal_expressions.q.out
index d7484cc..b9c7e1f 100644
--- a/ql/src/test/results/clientpositive/vector_decimal_expressions.q.out
+++ b/ql/src/test/results/clientpositive/vector_decimal_expressions.q.out
@@ -162,7 +162,7 @@ ORDER BY c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14) q
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@decimal_test_n1
 #### A masked pattern was here ####
--1300490595129
+-1300500065817
 PREHOOK: query: CREATE TABLE decimal_test_small_n0 STORED AS ORC AS SELECT cdouble, CAST (((cdouble*22.1)/37) AS DECIMAL(10,3)) AS cdecimal1, CAST (((cdouble*9.3)/13) AS DECIMAL(7,2)) AS cdecimal2 FROM alltypesorc
 PREHOOK: type: CREATETABLE_AS_SELECT
 PREHOOK: Input: default@alltypesorc
@@ -310,4 +310,4 @@ ORDER BY c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14) q
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@decimal_test_small_n0
 #### A masked pattern was here ####
-1273824888155
+1273832202747
diff --git a/serde/src/java/org/apache/hadoop/hive/serde2/io/DateWritableV2.java b/serde/src/java/org/apache/hadoop/hive/serde2/io/DateWritableV2.java
index ba77608..4b6a3d6 100644
--- a/serde/src/java/org/apache/hadoop/hive/serde2/io/DateWritableV2.java
+++ b/serde/src/java/org/apache/hadoop/hive/serde2/io/DateWritableV2.java
@@ -149,6 +149,6 @@ public class DateWritableV2 implements WritableComparable<DateWritableV2> {
 
   @Override
   public int hashCode() {
-    return date.hashCode();
+    return date.toEpochDay();
   }
 }
diff --git a/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java b/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java
index 9393fb8..8f7c8a3 100644
--- a/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java
+++ b/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java
@@ -31,6 +31,7 @@ import java.util.Map;
 
 import org.apache.hadoop.hive.serde2.io.DateWritableV2;
 import org.apache.hadoop.hive.serde2.io.TimestampLocalTZWritable;
+import org.apache.hadoop.hive.serde2.io.TimestampWritable;
 import org.apache.hadoop.hive.serde2.io.TimestampWritableV2;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.SettableTimestampLocalTZObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.TimestampLocalTZObjectInspector;
@@ -718,9 +719,11 @@ public final class ObjectInspectorUtils {
       case DATE:
         return ((DateObjectInspector) poi).getPrimitiveWritableObject(o).hashCode();
       case TIMESTAMP:
-        TimestampWritableV2 t = ((TimestampObjectInspector) poi)
-            .getPrimitiveWritableObject(o);
-        return t.hashCode();
+        // Use old timestamp writable hash code for backwards compatibility
+        TimestampWritable ts = new TimestampWritable(
+            java.sql.Timestamp.valueOf(
+                ((TimestampObjectInspector) poi).getPrimitiveWritableObject(o).toString()));
+        return ts.hashCode();
       case TIMESTAMPLOCALTZ:
         TimestampLocalTZWritable tstz = ((TimestampLocalTZObjectInspector) poi).getPrimitiveWritableObject(o);
         return tstz.hashCode();
diff --git a/serde/src/test/org/apache/hadoop/hive/serde2/objectinspector/TestObjectInspectorUtils.java b/serde/src/test/org/apache/hadoop/hive/serde2/objectinspector/TestObjectInspectorUtils.java
index 23ca194..5f90e22 100644
--- a/serde/src/test/org/apache/hadoop/hive/serde2/objectinspector/TestObjectInspectorUtils.java
+++ b/serde/src/test/org/apache/hadoop/hive/serde2/objectinspector/TestObjectInspectorUtils.java
@@ -23,6 +23,8 @@ import java.util.List;
 
 import junit.framework.TestCase;
 
+import org.apache.hadoop.hive.common.type.Date;
+import org.apache.hadoop.hive.common.type.Timestamp;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
 import org.apache.hadoop.hive.serde2.thrift.test.Complex;
@@ -131,6 +133,7 @@ public class TestObjectInspectorUtils extends TestCase {
     }
 
   }
+
   public void testBucketIdGeneration() {
     ArrayList<String> fieldNames = new ArrayList<String>();
     fieldNames.add("firstInteger");
@@ -156,4 +159,32 @@ public class TestObjectInspectorUtils extends TestCase {
     assertEquals("", 6, bucketId);
     assertEquals("", bucketId, ObjectInspectorUtils.getBucketNumber(hashCode, 16));
   }
+
+  public void testBucketHashGeneration() {
+    ArrayList<String> fieldNames = new ArrayList<String>();
+    fieldNames.add("d");
+    fieldNames.add("ts");
+    ArrayList<ObjectInspector> fieldObjectInspectors = new ArrayList<ObjectInspector>();
+    fieldObjectInspectors
+        .add(PrimitiveObjectInspectorFactory.javaDateObjectInspector);
+    fieldObjectInspectors
+        .add(PrimitiveObjectInspectorFactory.javaTimestampObjectInspector);
+    fieldObjectInspectors
+        .add(PrimitiveObjectInspectorFactory.javaTimestampObjectInspector);
+
+    StandardStructObjectInspector soi1 = ObjectInspectorFactory.getStandardStructObjectInspector(fieldNames, fieldObjectInspectors);
+    ArrayList<Object> struct = new ArrayList<Object>(2);
+    struct.add(Date.of(1970, 1, 1));
+    struct.add(Timestamp.valueOf("1969-12-31 16:00:00"));
+    struct.add(Timestamp.valueOf("1970-01-01 00:00:00"));
+
+    Object[] bucketFields = struct.toArray();
+    ObjectInspector[] bucketFieldInspectors = fieldObjectInspectors.toArray(new ObjectInspector[fieldObjectInspectors.size()]);
+    int fieldHash = ObjectInspectorUtils.hashCode(bucketFields[0], bucketFieldInspectors[0]);
+    assertEquals("", 0, fieldHash);
+    fieldHash = ObjectInspectorUtils.hashCode(bucketFields[1], bucketFieldInspectors[1]);
+    assertEquals("", 0, fieldHash);
+    fieldHash = ObjectInspectorUtils.hashCode(bucketFields[2], bucketFieldInspectors[2]);
+    assertEquals("", 7200, fieldHash);
+  }
 }