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 585384ab4b..960caff569 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 23ea4961a6..22fcd806ea 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 95f1573935..4884abb684 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 b729b943d8..95733c1c14 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 fieldNames = new ArrayList(); fieldNames.add("firstInteger"); @@ -156,4 +159,32 @@ public void testBucketIdGeneration() { assertEquals("", 6, bucketId); assertEquals("", bucketId, ObjectInspectorUtils.getBucketNumber(hashCode, 16)); } + + public void testBucketHashGeneration() { + ArrayList fieldNames = new ArrayList(); + fieldNames.add("d"); + fieldNames.add("ts"); + ArrayList fieldObjectInspectors = new ArrayList(); + fieldObjectInspectors + .add(PrimitiveObjectInspectorFactory.javaDateObjectInspector); + fieldObjectInspectors + .add(PrimitiveObjectInspectorFactory.javaTimestampObjectInspector); + fieldObjectInspectors + .add(PrimitiveObjectInspectorFactory.javaTimestampObjectInspector); + + StandardStructObjectInspector soi1 = ObjectInspectorFactory.getStandardStructObjectInspector(fieldNames, fieldObjectInspectors); + ArrayList struct = new ArrayList(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); + } }