HIVE-18499: Amend point lookup tests to check for data (Janaki Lahorani, reviewed by Sahil Takiar and Peter Vary)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/6924b9cd Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/6924b9cd Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/6924b9cd Branch: refs/heads/master Commit: 6924b9cd43311aa2d1faf158b39abd0bb8bacca2 Parents: 894efdb Author: Peter Vary <[email protected]> Authored: Mon Jan 29 18:23:31 2018 +0100 Committer: Peter Vary <[email protected]> Committed: Mon Jan 29 18:23:31 2018 +0100 ---------------------------------------------------------------------- .../test/queries/clientpositive/pointlookup.q | 140 +- .../test/queries/clientpositive/pointlookup2.q | 80 + .../test/queries/clientpositive/pointlookup3.q | 84 +- .../test/queries/clientpositive/pointlookup4.q | 10 + .../results/clientpositive/pointlookup.q.out | 344 +++- .../results/clientpositive/pointlookup2.q.out | 1698 ++++++++++++++++++ .../results/clientpositive/pointlookup3.q.out | 1595 +++++++++++++++- .../results/clientpositive/pointlookup4.q.out | 38 + 8 files changed, 3862 insertions(+), 127 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/6924b9cd/ql/src/test/queries/clientpositive/pointlookup.q ---------------------------------------------------------------------- diff --git a/ql/src/test/queries/clientpositive/pointlookup.q b/ql/src/test/queries/clientpositive/pointlookup.q index c460f39..951f77e 100644 --- a/ql/src/test/queries/clientpositive/pointlookup.q +++ b/ql/src/test/queries/clientpositive/pointlookup.q @@ -2,20 +2,35 @@ explain SELECT key FROM src WHERE - ((key = '0' - AND value = '8') OR (key = '1' - AND value = '5') OR (key = '2' - AND value = '6') OR (key = '3' - AND value = '8') OR (key = '4' - AND value = '1') OR (key = '5' - AND value = '6') OR (key = '6' - AND value = '1') OR (key = '7' - AND value = '1') OR (key = '8' - AND value = '1') OR (key = '9' - AND value = '1') OR (key = '10' - AND value = '3')) + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) ; +create table orOutput as +SELECT key +FROM src +WHERE + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) +; set hive.optimize.point.lookup.min=3; set hive.optimize.partition.columns.separate=false; @@ -23,18 +38,34 @@ explain SELECT key FROM src WHERE - ((key = '0' - AND value = '8') OR (key = '1' - AND value = '5') OR (key = '2' - AND value = '6') OR (key = '3' - AND value = '8') OR (key = '4' - AND value = '1') OR (key = '5' - AND value = '6') OR (key = '6' - AND value = '1') OR (key = '7' - AND value = '1') OR (key = '8' - AND value = '1') OR (key = '9' - AND value = '1') OR (key = '10' - AND value = '3')) + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) +; + +create table inOutput as +SELECT key +FROM src +WHERE + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) ; set hive.optimize.partition.columns.separate=true; @@ -42,16 +73,53 @@ explain SELECT key FROM src WHERE - ((key = '0' - AND value = '8') OR (key = '1' - AND value = '5') OR (key = '2' - AND value = '6') OR (key = '3' - AND value = '8') OR (key = '4' - AND value = '1') OR (key = '5' - AND value = '6') OR (key = '6' - AND value = '1') OR (key = '7' - AND value = '1') OR (key = '8' - AND value = '1') OR (key = '9' - AND value = '1') OR (key = '10' - AND value = '3')) + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) ; + +create table inOutputOpt as +SELECT key +FROM src +WHERE + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) +; + +-- Output from all these tables should be the same +select count(*) from orOutput; +select count(*) from inOutput; +select count(*) from inOutputOpt; + +-- check that orOutput and inOutput matches using full outer join +select orOutput.key, inOutput.key +from orOutput full outer join inOutput on (orOutput.key = inOutput.key) +where orOutput.key = null +or inOutput.key = null; + +-- check that ourOutput and inOutputOpt matches using full outer join +select orOutput.key, inOutputOpt.key +from orOutput full outer join inOutputOpt on (orOutput.key = inOutputOpt.key) +where orOutput.key = null +or inOutputOpt.key = null; + +drop table orOutput; +drop table inOutput; +drop table inOutputOpt; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hive/blob/6924b9cd/ql/src/test/queries/clientpositive/pointlookup2.q ---------------------------------------------------------------------- diff --git a/ql/src/test/queries/clientpositive/pointlookup2.q b/ql/src/test/queries/clientpositive/pointlookup2.q index 5891228..6e1cb07 100644 --- a/ql/src/test/queries/clientpositive/pointlookup2.q +++ b/ql/src/test/queries/clientpositive/pointlookup2.q @@ -14,6 +14,61 @@ insert overwrite table pcr_t2 select ds, key, value where ds='2000-04-08'; from pcr_t1 insert overwrite table pcr_t2 select ds, key, value where ds='2000-04-08' and key=2; +explain extended +select key, value, ds +from pcr_t1 +where (ds='2000-04-08' and key=1) or (ds='2000-04-09' and key=2) +order by key, value, ds; + +explain extended +select * +from pcr_t1 t1 join pcr_t1 t2 +on t1.key=t2.key and t1.ds='2000-04-08' and t2.ds='2000-04-08' +order by t1.key; + +explain extended +select * +from pcr_t1 t1 join pcr_t1 t2 +on t1.key=t2.key and t1.ds='2000-04-08' and t2.ds='2000-04-09' +order by t1.key; + +explain extended +select * +from pcr_t1 t1 join pcr_t2 t2 +where (t1.ds='2000-04-08' and t2.key=1) or (t1.ds='2000-04-09' and t2.key=2) +order by t2.key, t2.value, t1.ds; + +explain extended +select * +from pcr_t1 t1 join pcr_t2 t2 +where (t2.ds='2000-04-08' and t1.key=1) or (t2.ds='2000-04-09' and t1.key=2) +order by t1.key, t1.value, t2.ds; + +select key, value, ds +from pcr_t1 +where (ds='2000-04-08' and key=1) or (ds='2000-04-09' and key=2) +order by key, value, ds; + +select * +from pcr_t1 t1 join pcr_t1 t2 +on t1.key=t2.key and t1.ds='2000-04-08' and t2.ds='2000-04-08' +order by t1.key; + +select * +from pcr_t1 t1 join pcr_t2 t2 +where (t1.ds='2000-04-08' and t2.key=1) or (t1.ds='2000-04-09' and t2.key=2) +order by t2.key, t2.value, t1.ds; + +select * +from pcr_t1 t1 join pcr_t2 t2 +where (t1.ds='2000-04-08' and t2.key=1) or (t1.ds='2000-04-09' and t2.key=2) +order by t2.key, t2.value, t1.ds; + +select * +from pcr_t1 t1 join pcr_t2 t2 +where (t2.ds='2000-04-08' and t1.key=1) or (t2.ds='2000-04-09' and t1.key=2) +order by t1.key, t1.value, t2.ds; + set hive.optimize.point.lookup.min=2; set hive.optimize.partition.columns.separate=true; @@ -47,6 +102,31 @@ from pcr_t1 t1 join pcr_t2 t2 where (t2.ds='2000-04-08' and t1.key=1) or (t2.ds='2000-04-09' and t1.key=2) order by t1.key, t1.value, t2.ds; +select key, value, ds +from pcr_t1 +where (ds='2000-04-08' and key=1) or (ds='2000-04-09' and key=2) +order by key, value, ds; + +select * +from pcr_t1 t1 join pcr_t1 t2 +on t1.key=t2.key and t1.ds='2000-04-08' and t2.ds='2000-04-08' +order by t1.key; + +select * +from pcr_t1 t1 join pcr_t2 t2 +where (t1.ds='2000-04-08' and t2.key=1) or (t1.ds='2000-04-09' and t2.key=2) +order by t2.key, t2.value, t1.ds; + +select * +from pcr_t1 t1 join pcr_t2 t2 +where (t1.ds='2000-04-08' and t2.key=1) or (t1.ds='2000-04-09' and t2.key=2) +order by t2.key, t2.value, t1.ds; + +select * +from pcr_t1 t1 join pcr_t2 t2 +where (t2.ds='2000-04-08' and t1.key=1) or (t2.ds='2000-04-09' and t1.key=2) +order by t1.key, t1.value, t2.ds; + drop table pcr_t1; drop table pcr_t2; drop table pcr_t3; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hive/blob/6924b9cd/ql/src/test/queries/clientpositive/pointlookup3.q ---------------------------------------------------------------------- diff --git a/ql/src/test/queries/clientpositive/pointlookup3.q b/ql/src/test/queries/clientpositive/pointlookup3.q index e24bae1..bb934d0 100644 --- a/ql/src/test/queries/clientpositive/pointlookup3.q +++ b/ql/src/test/queries/clientpositive/pointlookup3.q @@ -6,6 +6,61 @@ insert overwrite table pcr_t1 partition (ds1='2000-04-08', ds2='2001-04-08') sel insert overwrite table pcr_t1 partition (ds1='2000-04-09', ds2='2001-04-09') select * from src where key < 20 order by key; insert overwrite table pcr_t1 partition (ds1='2000-04-10', ds2='2001-04-10') select * from src where key < 20 order by key; +explain extended +select key, value, ds1, ds2 +from pcr_t1 +where (ds1='2000-04-08' and key=1) or (ds1='2000-04-09' and key=2) +order by key, value, ds1, ds2; + +explain extended +select key, value, ds1, ds2 +from pcr_t1 +where (ds1='2000-04-08' and ds2='2001-04-08' and key=1) or (ds1='2000-04-09' and ds2='2001-04-08' and key=2) +order by key, value, ds1, ds2; + +explain extended +select * +from pcr_t1 t1 join pcr_t1 t2 +on t1.key=t2.key and t1.ds1='2000-04-08' and t2.ds2='2001-04-08' +order by t2.key, t2.value, t1.ds1; + +explain extended +select * +from pcr_t1 t1 join pcr_t1 t2 +on t1.key=t2.key and t1.ds1='2000-04-08' and t2.ds1='2000-04-09' +order by t2.key, t2.value, t1.ds1; + +explain extended +select * +from pcr_t1 t1 join pcr_t1 t2 +where (t1.ds1='2000-04-08' and t2.key=1) or (t1.ds1='2000-04-09' and t2.key=2) +order by t2.key, t2.value, t1.ds1; + +select key, value, ds1, ds2 +from pcr_t1 +where (ds1='2000-04-08' and key=1) or (ds1='2000-04-09' and key=2) +order by key, value, ds1, ds2; + +select key, value, ds1, ds2 +from pcr_t1 +where (ds1='2000-04-08' and ds2='2001-04-08' and key=1) or (ds1='2000-04-09' and ds2='2001-04-08' and key=2) +order by key, value, ds1, ds2; + +select * +from pcr_t1 t1 join pcr_t1 t2 +on t1.key=t2.key and t1.ds1='2000-04-08' and t2.ds2='2001-04-08' +order by t2.key, t2.value, t1.ds1; + +select * +from pcr_t1 t1 join pcr_t1 t2 +on t1.key=t2.key and t1.ds1='2000-04-08' and t2.ds1='2000-04-09' +order by t2.key, t2.value, t1.ds1; + +select * +from pcr_t1 t1 join pcr_t1 t2 +where (t1.ds1='2000-04-08' and t2.key=1) or (t1.ds1='2000-04-09' and t2.key=2) +order by t2.key, t2.value, t1.ds1; + set hive.optimize.point.lookup.min=2; set hive.optimize.partition.columns.separate=true; @@ -25,13 +80,13 @@ explain extended select * from pcr_t1 t1 join pcr_t1 t2 on t1.key=t2.key and t1.ds1='2000-04-08' and t2.ds2='2001-04-08' -order by t1.key; +order by t2.key, t2.value, t1.ds1; explain extended select * from pcr_t1 t1 join pcr_t1 t2 on t1.key=t2.key and t1.ds1='2000-04-08' and t2.ds1='2000-04-09' -order by t1.key; +order by t2.key, t2.value, t1.ds1; explain extended select * @@ -39,4 +94,29 @@ from pcr_t1 t1 join pcr_t1 t2 where (t1.ds1='2000-04-08' and t2.key=1) or (t1.ds1='2000-04-09' and t2.key=2) order by t2.key, t2.value, t1.ds1; +select key, value, ds1, ds2 +from pcr_t1 +where (ds1='2000-04-08' and key=1) or (ds1='2000-04-09' and key=2) +order by key, value, ds1, ds2; + +select key, value, ds1, ds2 +from pcr_t1 +where (ds1='2000-04-08' and ds2='2001-04-08' and key=1) or (ds1='2000-04-09' and ds2='2001-04-08' and key=2) +order by key, value, ds1, ds2; + +select * +from pcr_t1 t1 join pcr_t1 t2 +on t1.key=t2.key and t1.ds1='2000-04-08' and t2.ds2='2001-04-08' +order by t2.key, t2.value, t1.ds1; + +select * +from pcr_t1 t1 join pcr_t1 t2 +on t1.key=t2.key and t1.ds1='2000-04-08' and t2.ds1='2000-04-09' +order by t2.key, t2.value, t1.ds1; + +select * +from pcr_t1 t1 join pcr_t1 t2 +where (t1.ds1='2000-04-08' and t2.key=1) or (t1.ds1='2000-04-09' and t2.key=2) +order by t2.key, t2.value, t1.ds1; + drop table pcr_t1; http://git-wip-us.apache.org/repos/asf/hive/blob/6924b9cd/ql/src/test/queries/clientpositive/pointlookup4.q ---------------------------------------------------------------------- diff --git a/ql/src/test/queries/clientpositive/pointlookup4.q b/ql/src/test/queries/clientpositive/pointlookup4.q index 5832573..ba25301 100644 --- a/ql/src/test/queries/clientpositive/pointlookup4.q +++ b/ql/src/test/queries/clientpositive/pointlookup4.q @@ -15,6 +15,11 @@ from pcr_t1 where (ds1='2000-04-08' and ds2='2001-04-08' and key=1) or (ds1='2000-04-09' and ds2='2001-04-09' and key=2) order by key, value, ds1, ds2; +select key, value, ds1, ds2 +from pcr_t1 +where (ds1='2000-04-08' and ds2='2001-04-08' and key=1) or (ds1='2000-04-09' and ds2='2001-04-09' and key=2) +order by key, value, ds1, ds2; + set hive.optimize.point.lookup=true; set hive.optimize.point.lookup.min=0; set hive.optimize.partition.columns.separate=true; @@ -25,4 +30,9 @@ from pcr_t1 where (ds1='2000-04-08' and ds2='2001-04-08' and key=1) or (ds1='2000-04-09' and ds2='2001-04-09' and key=2) order by key, value, ds1, ds2; +select key, value, ds1, ds2 +from pcr_t1 +where (ds1='2000-04-08' and ds2='2001-04-08' and key=1) or (ds1='2000-04-09' and ds2='2001-04-09' and key=2) +order by key, value, ds1, ds2; + drop table pcr_t1; http://git-wip-us.apache.org/repos/asf/hive/blob/6924b9cd/ql/src/test/results/clientpositive/pointlookup.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/pointlookup.q.out b/ql/src/test/results/clientpositive/pointlookup.q.out index 4b58eb7..3e3f001 100644 --- a/ql/src/test/results/clientpositive/pointlookup.q.out +++ b/ql/src/test/results/clientpositive/pointlookup.q.out @@ -2,35 +2,33 @@ PREHOOK: query: explain SELECT key FROM src WHERE - ((key = '0' - AND value = '8') OR (key = '1' - AND value = '5') OR (key = '2' - AND value = '6') OR (key = '3' - AND value = '8') OR (key = '4' - AND value = '1') OR (key = '5' - AND value = '6') OR (key = '6' - AND value = '1') OR (key = '7' - AND value = '1') OR (key = '8' - AND value = '1') OR (key = '9' - AND value = '1') OR (key = '10' - AND value = '3')) + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) PREHOOK: type: QUERY POSTHOOK: query: explain SELECT key FROM src WHERE - ((key = '0' - AND value = '8') OR (key = '1' - AND value = '5') OR (key = '2' - AND value = '6') OR (key = '3' - AND value = '8') OR (key = '4' - AND value = '1') OR (key = '5' - AND value = '6') OR (key = '6' - AND value = '1') OR (key = '7' - AND value = '1') OR (key = '8' - AND value = '1') OR (key = '9' - AND value = '1') OR (key = '10' - AND value = '3')) + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-1 is a root stage @@ -44,7 +42,7 @@ STAGE PLANS: alias: src Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE Filter Operator - predicate: (((key = '0') and (value = '8')) or ((key = '1') and (value = '5')) or ((key = '10') and (value = '3')) or ((key = '2') and (value = '6')) or ((key = '3') and (value = '8')) or ((key = '4') and (value = '1')) or ((key = '5') and (value = '6')) or ((key = '6') and (value = '1')) or ((key = '7') and (value = '1')) or ((key = '8') and (value = '1')) or ((key = '9') and (value = '1'))) (type: boolean) + predicate: (((key = '0') and (value = 'val_0')) or ((key = '1') and (value = 'val_1')) or ((key = '10') and (value = 'val_10')) or ((key = '2') and (value = 'val_2')) or ((key = '3') and (value = 'val_3')) or ((key = '4') and (value = 'val_4')) or ((key = '5') and (value = 'val_5')) or ((key = '6') and (value = 'val_6')) or ((key = '7') and (value = 'val_7')) or ((key = '8') and (value = 'val_8')) or ((key = '9') and (value = 'val_9'))) (type: boolean) Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: key (type: string) @@ -64,39 +62,76 @@ STAGE PLANS: Processor Tree: ListSink +PREHOOK: query: create table orOutput as +SELECT key +FROM src +WHERE + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) +PREHOOK: type: CREATETABLE_AS_SELECT +PREHOOK: Input: default@src +PREHOOK: Output: database:default +PREHOOK: Output: default@orOutput +POSTHOOK: query: create table orOutput as +SELECT key +FROM src +WHERE + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) +POSTHOOK: type: CREATETABLE_AS_SELECT +POSTHOOK: Input: default@src +POSTHOOK: Output: database:default +POSTHOOK: Output: default@orOutput +POSTHOOK: Lineage: oroutput.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: explain SELECT key FROM src WHERE - ((key = '0' - AND value = '8') OR (key = '1' - AND value = '5') OR (key = '2' - AND value = '6') OR (key = '3' - AND value = '8') OR (key = '4' - AND value = '1') OR (key = '5' - AND value = '6') OR (key = '6' - AND value = '1') OR (key = '7' - AND value = '1') OR (key = '8' - AND value = '1') OR (key = '9' - AND value = '1') OR (key = '10' - AND value = '3')) + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) PREHOOK: type: QUERY POSTHOOK: query: explain SELECT key FROM src WHERE - ((key = '0' - AND value = '8') OR (key = '1' - AND value = '5') OR (key = '2' - AND value = '6') OR (key = '3' - AND value = '8') OR (key = '4' - AND value = '1') OR (key = '5' - AND value = '6') OR (key = '6' - AND value = '1') OR (key = '7' - AND value = '1') OR (key = '8' - AND value = '1') OR (key = '9' - AND value = '1') OR (key = '10' - AND value = '3')) + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-1 is a root stage @@ -110,7 +145,7 @@ STAGE PLANS: alias: src Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE Filter Operator - predicate: (struct(key,value)) IN (const struct('0','8'), const struct('1','5'), const struct('2','6'), const struct('3','8'), const struct('4','1'), const struct('5','6'), const struct('6','1'), const struct('7','1'), const struct('8','1'), const struct('9','1'), const struct('10','3')) (type: boolean) + predicate: (struct(key,value)) IN (const struct('0','val_0'), const struct('1','val_1'), const struct('2','val_2'), const struct('3','val_3'), const struct('4','val_4'), const struct('5','val_5'), const struct('6','val_6'), const struct('7','val_7'), const struct('8','val_8'), const struct('9','val_9'), const struct('10','val_10')) (type: boolean) Statistics: Num rows: 125 Data size: 1328 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: key (type: string) @@ -130,39 +165,76 @@ STAGE PLANS: Processor Tree: ListSink +PREHOOK: query: create table inOutput as +SELECT key +FROM src +WHERE + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) +PREHOOK: type: CREATETABLE_AS_SELECT +PREHOOK: Input: default@src +PREHOOK: Output: database:default +PREHOOK: Output: default@inOutput +POSTHOOK: query: create table inOutput as +SELECT key +FROM src +WHERE + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) +POSTHOOK: type: CREATETABLE_AS_SELECT +POSTHOOK: Input: default@src +POSTHOOK: Output: database:default +POSTHOOK: Output: default@inOutput +POSTHOOK: Lineage: inoutput.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: explain SELECT key FROM src WHERE - ((key = '0' - AND value = '8') OR (key = '1' - AND value = '5') OR (key = '2' - AND value = '6') OR (key = '3' - AND value = '8') OR (key = '4' - AND value = '1') OR (key = '5' - AND value = '6') OR (key = '6' - AND value = '1') OR (key = '7' - AND value = '1') OR (key = '8' - AND value = '1') OR (key = '9' - AND value = '1') OR (key = '10' - AND value = '3')) + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) PREHOOK: type: QUERY POSTHOOK: query: explain SELECT key FROM src WHERE - ((key = '0' - AND value = '8') OR (key = '1' - AND value = '5') OR (key = '2' - AND value = '6') OR (key = '3' - AND value = '8') OR (key = '4' - AND value = '1') OR (key = '5' - AND value = '6') OR (key = '6' - AND value = '1') OR (key = '7' - AND value = '1') OR (key = '8' - AND value = '1') OR (key = '9' - AND value = '1') OR (key = '10' - AND value = '3')) + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-1 is a root stage @@ -176,7 +248,7 @@ STAGE PLANS: alias: src Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE Filter Operator - predicate: (struct(key,value)) IN (const struct('0','8'), const struct('1','5'), const struct('2','6'), const struct('3','8'), const struct('4','1'), const struct('5','6'), const struct('6','1'), const struct('7','1'), const struct('8','1'), const struct('9','1'), const struct('10','3')) (type: boolean) + predicate: (struct(key,value)) IN (const struct('0','val_0'), const struct('1','val_1'), const struct('2','val_2'), const struct('3','val_3'), const struct('4','val_4'), const struct('5','val_5'), const struct('6','val_6'), const struct('7','val_7'), const struct('8','val_8'), const struct('9','val_9'), const struct('10','val_10')) (type: boolean) Statistics: Num rows: 125 Data size: 1328 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: key (type: string) @@ -196,3 +268,125 @@ STAGE PLANS: Processor Tree: ListSink +PREHOOK: query: create table inOutputOpt as +SELECT key +FROM src +WHERE + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) +PREHOOK: type: CREATETABLE_AS_SELECT +PREHOOK: Input: default@src +PREHOOK: Output: database:default +PREHOOK: Output: default@inOutputOpt +POSTHOOK: query: create table inOutputOpt as +SELECT key +FROM src +WHERE + ((key = '0' AND value = 'val_0') OR + (key = '1' AND value = 'val_1') OR + (key = '2' AND value = 'val_2') OR + (key = '3' AND value = 'val_3') OR + (key = '4' AND value = 'val_4') OR + (key = '5' AND value = 'val_5') OR + (key = '6' AND value = 'val_6') OR + (key = '7' AND value = 'val_7') OR + (key = '8' AND value = 'val_8') OR + (key = '9' AND value = 'val_9') OR + (key = '10' AND value = 'val_10')) +POSTHOOK: type: CREATETABLE_AS_SELECT +POSTHOOK: Input: default@src +POSTHOOK: Output: database:default +POSTHOOK: Output: default@inOutputOpt +POSTHOOK: Lineage: inoutputopt.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] +PREHOOK: query: select count(*) from orOutput +PREHOOK: type: QUERY +PREHOOK: Input: default@oroutput +#### A masked pattern was here #### +POSTHOOK: query: select count(*) from orOutput +POSTHOOK: type: QUERY +POSTHOOK: Input: default@oroutput +#### A masked pattern was here #### +11 +PREHOOK: query: select count(*) from inOutput +PREHOOK: type: QUERY +PREHOOK: Input: default@inoutput +#### A masked pattern was here #### +POSTHOOK: query: select count(*) from inOutput +POSTHOOK: type: QUERY +POSTHOOK: Input: default@inoutput +#### A masked pattern was here #### +11 +PREHOOK: query: select count(*) from inOutputOpt +PREHOOK: type: QUERY +PREHOOK: Input: default@inoutputopt +#### A masked pattern was here #### +POSTHOOK: query: select count(*) from inOutputOpt +POSTHOOK: type: QUERY +POSTHOOK: Input: default@inoutputopt +#### A masked pattern was here #### +11 +PREHOOK: query: select orOutput.key, inOutput.key +from orOutput full outer join inOutput on (orOutput.key = inOutput.key) +where orOutput.key = null +or inOutput.key = null +PREHOOK: type: QUERY +PREHOOK: Input: default@inoutput +PREHOOK: Input: default@oroutput +#### A masked pattern was here #### +POSTHOOK: query: select orOutput.key, inOutput.key +from orOutput full outer join inOutput on (orOutput.key = inOutput.key) +where orOutput.key = null +or inOutput.key = null +POSTHOOK: type: QUERY +POSTHOOK: Input: default@inoutput +POSTHOOK: Input: default@oroutput +#### A masked pattern was here #### +PREHOOK: query: select orOutput.key, inOutputOpt.key +from orOutput full outer join inOutputOpt on (orOutput.key = inOutputOpt.key) +where orOutput.key = null +or inOutputOpt.key = null +PREHOOK: type: QUERY +PREHOOK: Input: default@inoutputopt +PREHOOK: Input: default@oroutput +#### A masked pattern was here #### +POSTHOOK: query: select orOutput.key, inOutputOpt.key +from orOutput full outer join inOutputOpt on (orOutput.key = inOutputOpt.key) +where orOutput.key = null +or inOutputOpt.key = null +POSTHOOK: type: QUERY +POSTHOOK: Input: default@inoutputopt +POSTHOOK: Input: default@oroutput +#### A masked pattern was here #### +PREHOOK: query: drop table orOutput +PREHOOK: type: DROPTABLE +PREHOOK: Input: default@oroutput +PREHOOK: Output: default@oroutput +POSTHOOK: query: drop table orOutput +POSTHOOK: type: DROPTABLE +POSTHOOK: Input: default@oroutput +POSTHOOK: Output: default@oroutput +PREHOOK: query: drop table inOutput +PREHOOK: type: DROPTABLE +PREHOOK: Input: default@inoutput +PREHOOK: Output: default@inoutput +POSTHOOK: query: drop table inOutput +POSTHOOK: type: DROPTABLE +POSTHOOK: Input: default@inoutput +POSTHOOK: Output: default@inoutput +PREHOOK: query: drop table inOutputOpt +PREHOOK: type: DROPTABLE +PREHOOK: Input: default@inoutputopt +PREHOOK: Output: default@inoutputopt +POSTHOOK: query: drop table inOutputOpt +POSTHOOK: type: DROPTABLE +POSTHOOK: Input: default@inoutputopt +POSTHOOK: Output: default@inoutputopt
