You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by pr...@apache.org on 2016/10/12 07:27:45 UTC

[32/37] hive git commit: HIVE-14877: Move slow CliDriver tests to MiniLlap (Prasanth Jayachandran reviewed by Siddharth Seth)

http://git-wip-us.apache.org/repos/asf/hive/blob/1f258e96/ql/src/test/results/clientpositive/llap/cbo_rp_lineage2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/cbo_rp_lineage2.q.out b/ql/src/test/results/clientpositive/llap/cbo_rp_lineage2.q.out
new file mode 100644
index 0000000..eac1554
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/cbo_rp_lineage2.q.out
@@ -0,0 +1,677 @@
+PREHOOK: query: drop table if exists src2
+PREHOOK: type: DROPTABLE
+PREHOOK: query: create table src2 as select key key2, value value2 from src1
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src1
+PREHOOK: Output: database:default
+PREHOOK: Output: default@src2
+{"version":"1.0","engine":"tez","database":"default","hash":"3a39d46286e4c2cd2139c9bb248f7b4f","queryText":"create table src2 as select key key2, value value2 from src1","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.src2.key2"},{"id":1,"vertexType":"COLUMN","vertexId":"default.src2.value2"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.value"}]}
+PREHOOK: query: select * from src1 where key is not null and value is not null limit 3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"b5b224847b2333e790a2c229434a04c8","queryText":"select * from src1 where key is not null and value is not null limit 3","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"},{"sources":[2,3],"targets":[0,1],"expression":"(src1.key is not null and src1.value is not null)","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"src1.key"},{"id":1,"vertexType":"COLUMN","vertexId":"src1.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.value"}]}
+238	val_238
+	
+311	val_311
+PREHOOK: query: select * from src1 where key > 10 and value > 'val' order by key limit 5
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"773d9d0ea92e797eae292ae1eeea11ab","queryText":"select * from src1 where key > 10 and value > 'val' order by key limit 5","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"},{"sources":[2,3],"targets":[0,1],"expression":"((UDFToDouble(src1.key) > 10.0) and (src1.value > 'val'))","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"src1.key"},{"id":1,"vertexType":"COLUMN","vertexId":"src1.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.value"}]}
+146	val_146
+150	val_150
+213	val_213
+238	val_238
+255	val_255
+PREHOOK: query: drop table if exists dest1
+PREHOOK: type: DROPTABLE
+PREHOOK: query: create table dest1 as select * from src1
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src1
+PREHOOK: Output: database:default
+PREHOOK: Output: default@dest1
+{"version":"1.0","engine":"tez","database":"default","hash":"712fe958c357bcfc978b95c43eb19084","queryText":"create table dest1 as select * from src1","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.dest1.key"},{"id":1,"vertexType":"COLUMN","vertexId":"default.dest1.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.value"}]}
+PREHOOK: query: insert into table dest1 select * from src2
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src2
+PREHOOK: Output: default@dest1
+{"version":"1.0","engine":"tez","database":"default","hash":"ecc718a966d8887b18084a55dd96f0bc","queryText":"insert into table dest1 select * from src2","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.dest1.key"},{"id":1,"vertexType":"COLUMN","vertexId":"default.dest1.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src2.key2"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src2.value2"}]}
+PREHOOK: query: select key k, dest1.value from dest1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"416b6f4cd63edd4f9d8213d2d7819d21","queryText":"select key k, dest1.value from dest1","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"k"},{"id":1,"vertexType":"COLUMN","vertexId":"dest1.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.dest1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.dest1.value"}]}
+238	val_238
+	
+311	val_311
+	val_27
+	val_165
+	val_409
+255	val_255
+278	val_278
+98	val_98
+	val_484
+	val_265
+	val_193
+401	val_401
+150	val_150
+273	val_273
+224	
+369	
+66	val_66
+128	
+213	val_213
+146	val_146
+406	val_406
+	
+	
+	
+238	val_238
+	
+311	val_311
+	val_27
+	val_165
+	val_409
+255	val_255
+278	val_278
+98	val_98
+	val_484
+	val_265
+	val_193
+401	val_401
+150	val_150
+273	val_273
+224	
+369	
+66	val_66
+128	
+213	val_213
+146	val_146
+406	val_406
+	
+	
+	
+PREHOOK: query: select key from src1 union select key2 from src2 order by key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src1
+PREHOOK: Input: default@src2
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"50fa3d1074b3fda37ce11dc6ec92ebf3","queryText":"select key from src1 union select key2 from src2 order by key","edges":[{"sources":[1,2],"targets":[0],"expression":"KEY.reducesinkkey0","edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"key"},{"id":1,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src2.key2"}]}
+
+128
+146
+150
+213
+224
+238
+255
+273
+278
+311
+369
+401
+406
+66
+98
+PREHOOK: query: select key k from src1 union select key2 from src2 order by k
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src1
+PREHOOK: Input: default@src2
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"a739460bd79c8c91ec35e22c97329769","queryText":"select key k from src1 union select key2 from src2 order by k","edges":[{"sources":[1,2],"targets":[0],"expression":"KEY.reducesinkkey0","edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"k"},{"id":1,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src2.key2"}]}
+
+128
+146
+150
+213
+224
+238
+255
+273
+278
+311
+369
+401
+406
+66
+98
+PREHOOK: query: select key, count(1) a from dest1 group by key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"3901b5e3a164064736b3234355046340","queryText":"select key, count(1) a from dest1 group by key","edges":[],"vertices":[]}
+	20
+128	2
+146	2
+150	2
+213	2
+224	2
+238	2
+255	2
+273	2
+278	2
+311	2
+369	2
+401	2
+406	2
+66	2
+98	2
+PREHOOK: query: select key k, count(*) from dest1 group by key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"0d5a212f10847aeaab31e8c31121e6d4","queryText":"select key k, count(*) from dest1 group by key","edges":[],"vertices":[]}
+	20
+128	2
+146	2
+150	2
+213	2
+224	2
+238	2
+255	2
+273	2
+278	2
+311	2
+369	2
+401	2
+406	2
+66	2
+98	2
+PREHOOK: query: select key k, count(value) from dest1 group by key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"56429eccb04ded722f5bd9d9d8cf7260","queryText":"select key k, count(value) from dest1 group by key","edges":[],"vertices":[]}
+	20
+128	2
+146	2
+150	2
+213	2
+224	2
+238	2
+255	2
+273	2
+278	2
+311	2
+369	2
+401	2
+406	2
+66	2
+98	2
+PREHOOK: query: select value, max(length(key)) from dest1 group by value
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"7e1cfc3dece85b41b6f7c46365580cde","queryText":"select value, max(length(key)) from dest1 group by value","edges":[],"vertices":[]}
+	3
+val_146	3
+val_150	3
+val_165	0
+val_193	0
+val_213	3
+val_238	3
+val_255	3
+val_265	0
+val_27	0
+val_273	3
+val_278	3
+val_311	3
+val_401	3
+val_406	3
+val_409	0
+val_484	0
+val_66	2
+val_98	2
+PREHOOK: query: select value, max(length(key)) from dest1 group by value order by value limit 5
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"c6578ce1dd72498c4af33f20f164e483","queryText":"select value, max(length(key)) from dest1 group by value order by value limit 5","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"expression":"max(length(dest1.key))","edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"value"},{"id":1,"vertexType":"COLUMN","vertexId":"_c1"},{"id":2,"vertexType":"COLUMN","vertexId":"default.dest1.value"},{"id":3,"vertexType":"COLUMN","vertexId":"default.dest1.key"}]}
+	3
+val_146	3
+val_150	3
+val_165	0
+val_193	0
+PREHOOK: query: select key, length(value) from dest1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"91fbcea5cb34362071555cd93e8d0abe","queryText":"select key, length(value) from dest1","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"expression":"length(dest1.value)","edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"key"},{"id":1,"vertexType":"COLUMN","vertexId":"_c1"},{"id":2,"vertexType":"COLUMN","vertexId":"default.dest1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.dest1.value"}]}
+238	7
+	0
+311	7
+	6
+	7
+	7
+255	7
+278	7
+98	6
+	7
+	7
+	7
+401	7
+150	7
+273	7
+224	0
+369	0
+66	6
+128	0
+213	7
+146	7
+406	7
+	0
+	0
+	0
+238	7
+	0
+311	7
+	6
+	7
+	7
+255	7
+278	7
+98	6
+	7
+	7
+	7
+401	7
+150	7
+273	7
+224	0
+369	0
+66	6
+128	0
+213	7
+146	7
+406	7
+	0
+	0
+	0
+PREHOOK: query: select length(value) + 3 from dest1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"3d8a347cc9052111cb328938d37b9b03","queryText":"select length(value) + 3 from dest1","edges":[{"sources":[1],"targets":[0],"expression":"(length(dest1.value) + 3)","edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"_c0"},{"id":1,"vertexType":"COLUMN","vertexId":"default.dest1.value"}]}
+10
+3
+10
+9
+10
+10
+10
+10
+9
+10
+10
+10
+10
+10
+10
+3
+3
+9
+3
+10
+10
+10
+3
+3
+3
+10
+3
+10
+9
+10
+10
+10
+10
+9
+10
+10
+10
+10
+10
+10
+3
+3
+9
+3
+10
+10
+10
+3
+3
+3
+PREHOOK: query: select 5 from dest1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"bae960bf4376ec00e37258469b17360d","queryText":"select 5 from dest1","edges":[{"sources":[],"targets":[0],"expression":"5","edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"_c0"}]}
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+PREHOOK: query: select 3 * 5 from dest1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"753abad4d55afd3df34fdc73abfcd44d","queryText":"select 3 * 5 from dest1","edges":[{"sources":[],"targets":[0],"expression":"15","edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"_c0"}]}
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+15
+PREHOOK: query: drop table if exists dest2
+PREHOOK: type: DROPTABLE
+PREHOOK: query: create table dest2 as select * from src1 JOIN src2 ON src1.key = src2.key2
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src1
+PREHOOK: Input: default@src2
+PREHOOK: Output: database:default
+PREHOOK: Output: default@dest2
+{"version":"1.0","engine":"tez","database":"default","hash":"386791c174a4999fc916e300b5e76bf2","queryText":"create table dest2 as select * from src1 JOIN src2 ON src1.key = src2.key2","edges":[{"sources":[4],"targets":[0],"edgeType":"PROJECTION"},{"sources":[5],"targets":[1],"edgeType":"PROJECTION"},{"sources":[6],"targets":[2],"edgeType":"PROJECTION"},{"sources":[7],"targets":[3],"edgeType":"PROJECTION"},{"sources":[4],"targets":[0,1,2,3],"expression":"src1.key is not null","edgeType":"PREDICATE"},{"sources":[4,6],"targets":[0,1,2,3],"expression":"(src1.key = src2.key2)","edgeType":"PREDICATE"},{"sources":[6],"targets":[0,1,2,3],"expression":"src2.key2 is not null","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.dest2.key"},{"id":1,"vertexType":"COLUMN","vertexId":"default.dest2.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.dest2.key2"},{"id":3,"vertexType":"COLUMN","vertexId":"default.dest2.value2"},{"id":4,"vertexType":"COLUMN","
 vertexId":"default.src1.key"},{"id":5,"vertexType":"COLUMN","vertexId":"default.src1.value"},{"id":6,"vertexType":"COLUMN","vertexId":"default.src2.key2"},{"id":7,"vertexType":"COLUMN","vertexId":"default.src2.value2"}]}
+PREHOOK: query: insert overwrite table dest2 select * from src1 JOIN src2 ON src1.key = src2.key2
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src1
+PREHOOK: Input: default@src2
+PREHOOK: Output: default@dest2
+{"version":"1.0","engine":"tez","database":"default","hash":"e494b771d94800dc3430bf5d0810cd9f","queryText":"insert overwrite table dest2 select * from src1 JOIN src2 ON src1.key = src2.key2","edges":[],"vertices":[]}
+PREHOOK: query: insert into table dest2 select * from src1 JOIN src2 ON src1.key = src2.key2
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src1
+PREHOOK: Input: default@src2
+PREHOOK: Output: default@dest2
+{"version":"1.0","engine":"tez","database":"default","hash":"efeaddd0d36105b1013b414627850dc2","queryText":"insert into table dest2 select * from src1 JOIN src2 ON src1.key = src2.key2","edges":[],"vertices":[]}
+PREHOOK: query: insert into table dest2
+  select * from src1 JOIN src2 ON length(src1.value) = length(src2.value2) + 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src1
+PREHOOK: Input: default@src2
+PREHOOK: Output: default@dest2
+{"version":"1.0","engine":"tez","database":"default","hash":"e9450a56b3d103642e06bef0e4f0d482","queryText":"insert into table dest2\n  select * from src1 JOIN src2 ON length(src1.value) = length(src2.value2) + 1","edges":[],"vertices":[]}
+PREHOOK: query: select * from src1 where length(key) > 2
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"4028c94d222d5dd221f651d414386972","queryText":"select * from src1 where length(key) > 2","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"},{"sources":[2],"targets":[0,1],"expression":"(length(src1.key) > 2)","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"src1.key"},{"id":1,"vertexType":"COLUMN","vertexId":"src1.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.value"}]}
+238	val_238
+311	val_311
+255	val_255
+278	val_278
+401	val_401
+150	val_150
+273	val_273
+224	
+369	
+128	
+213	val_213
+146	val_146
+406	val_406
+PREHOOK: query: select * from src1 where length(key) > 2 and value > 'a'
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"5727531f7743cfcd60d634d8c835515f","queryText":"select * from src1 where length(key) > 2 and value > 'a'","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"},{"sources":[2,3],"targets":[0,1],"expression":"((length(src1.key) > 2) and (src1.value > 'a'))","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"src1.key"},{"id":1,"vertexType":"COLUMN","vertexId":"src1.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.value"}]}
+238	val_238
+311	val_311
+255	val_255
+278	val_278
+401	val_401
+150	val_150
+273	val_273
+213	val_213
+146	val_146
+406	val_406
+PREHOOK: query: drop table if exists dest3
+PREHOOK: type: DROPTABLE
+PREHOOK: query: create table dest3 as
+  select * from src1 JOIN src2 ON src1.key = src2.key2 WHERE length(key) > 1
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src1
+PREHOOK: Input: default@src2
+PREHOOK: Output: database:default
+PREHOOK: Output: default@dest3
+{"version":"1.0","engine":"tez","database":"default","hash":"a2c4e9a3ec678039814f5d84b1e38ce4","queryText":"create table dest3 as\n  select * from src1 JOIN src2 ON src1.key = src2.key2 WHERE length(key) > 1","edges":[{"sources":[4],"targets":[0],"edgeType":"PROJECTION"},{"sources":[5],"targets":[1],"edgeType":"PROJECTION"},{"sources":[6],"targets":[2],"edgeType":"PROJECTION"},{"sources":[7],"targets":[3],"edgeType":"PROJECTION"},{"sources":[4],"targets":[0,1,2,3],"expression":"((length(src1.key) > 1) and src1.key is not null)","edgeType":"PREDICATE"},{"sources":[4,6],"targets":[0,1,2,3],"expression":"(src1.key = src2.key2)","edgeType":"PREDICATE"},{"sources":[6],"targets":[0,1,2,3],"expression":"((length(src2.key2) > 1) and src2.key2 is not null)","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.dest3.key"},{"id":1,"vertexType":"COLUMN","vertexId":"default.dest3.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.dest3.key2"},{"id":3,"ver
 texType":"COLUMN","vertexId":"default.dest3.value2"},{"id":4,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":5,"vertexType":"COLUMN","vertexId":"default.src1.value"},{"id":6,"vertexType":"COLUMN","vertexId":"default.src2.key2"},{"id":7,"vertexType":"COLUMN","vertexId":"default.src2.value2"}]}
+PREHOOK: query: insert overwrite table dest2
+  select * from src1 JOIN src2 ON src1.key = src2.key2 WHERE length(key) > 3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src1
+PREHOOK: Input: default@src2
+PREHOOK: Output: default@dest2
+{"version":"1.0","engine":"tez","database":"default","hash":"76d84512204ddc576ad4d93f252e4358","queryText":"insert overwrite table dest2\n  select * from src1 JOIN src2 ON src1.key = src2.key2 WHERE length(key) > 3","edges":[],"vertices":[]}
+PREHOOK: query: drop table if exists dest_l1
+PREHOOK: type: DROPTABLE
+PREHOOK: query: CREATE TABLE dest_l1(key INT, value STRING) STORED AS TEXTFILE
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@dest_l1
+PREHOOK: query: INSERT OVERWRITE TABLE dest_l1
+SELECT j.*
+FROM (SELECT t1.key, p1.value
+      FROM src1 t1
+      LEFT OUTER JOIN src p1
+      ON (t1.key = p1.key)
+      UNION ALL
+      SELECT t2.key, p2.value
+      FROM src1 t2
+      LEFT OUTER JOIN src p2
+      ON (t2.key = p2.key)) j
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Input: default@src1
+PREHOOK: Output: default@dest_l1
+{"version":"1.0","engine":"tez","database":"default","hash":"60b589744e2527dd235a6c8168d6a653","queryText":"INSERT OVERWRITE TABLE dest_l1\nSELECT j.*\nFROM (SELECT t1.key, p1.value\n      FROM src1 t1\n      LEFT OUTER JOIN src p1\n      ON (t1.key = p1.key)\n      UNION ALL\n      SELECT t2.key, p2.value\n      FROM src1 t2\n      LEFT OUTER JOIN src p2\n      ON (t2.key = p2.key)) j","edges":[{"sources":[2],"targets":[0],"expression":"UDFToInteger(key)","edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"expression":"value","edgeType":"PROJECTION"},{"sources":[4,2],"targets":[0,1],"expression":"(j-subquery1:_u1-subquery1:p1.key = j-subquery1:_u1-subquery1:t1.key)","edgeType":"PREDICATE"},{"sources":[4,2],"targets":[0,1],"expression":"(j-subquery2:_u1-subquery2:p2.key = j-subquery2:_u1-subquery2:t2.key)","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.dest_l1.key"},{"id":1,"vertexType":"COLUMN","vertexId":"default.dest_l1.value"},{"id":2,"
 vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src.value"},{"id":4,"vertexType":"COLUMN","vertexId":"default.src.key"}]}
+PREHOOK: query: drop table if exists emp
+PREHOOK: type: DROPTABLE
+PREHOOK: query: drop table if exists dept
+PREHOOK: type: DROPTABLE
+PREHOOK: query: drop table if exists project
+PREHOOK: type: DROPTABLE
+PREHOOK: query: drop table if exists tgt
+PREHOOK: type: DROPTABLE
+PREHOOK: query: create table emp(emp_id int, name string, mgr_id int, dept_id int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@emp
+PREHOOK: query: create table dept(dept_id int, dept_name string)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@dept
+PREHOOK: query: create table project(project_id int, project_name string)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@project
+PREHOOK: query: create table tgt(dept_name string, name string,
+  emp_id int, mgr_id int, proj_id int, proj_name string)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@tgt
+PREHOOK: query: INSERT INTO TABLE tgt
+SELECT emd.dept_name, emd.name, emd.emp_id, emd.mgr_id, p.project_id, p.project_name
+FROM (
+  SELECT d.dept_name, em.name, em.emp_id, em.mgr_id, em.dept_id
+  FROM (
+    SELECT e.name, e.dept_id, e.emp_id emp_id, m.emp_id mgr_id
+    FROM emp e JOIN emp m ON e.emp_id = m.emp_id
+    ) em
+  JOIN dept d ON d.dept_id = em.dept_id
+  ) emd JOIN project p ON emd.dept_id = p.project_id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dept
+PREHOOK: Input: default@emp
+PREHOOK: Input: default@project
+PREHOOK: Output: default@tgt
+{"version":"1.0","engine":"tez","database":"default","hash":"f59797e0422d2e51515063374dfac361","queryText":"INSERT INTO TABLE tgt\nSELECT emd.dept_name, emd.name, emd.emp_id, emd.mgr_id, p.project_id, p.project_name\nFROM (\n  SELECT d.dept_name, em.name, em.emp_id, em.mgr_id, em.dept_id\n  FROM (\n    SELECT e.name, e.dept_id, e.emp_id emp_id, m.emp_id mgr_id\n    FROM emp e JOIN emp m ON e.emp_id = m.emp_id\n    ) em\n  JOIN dept d ON d.dept_id = em.dept_id\n  ) emd JOIN project p ON emd.dept_id = p.project_id","edges":[{"sources":[6],"targets":[0],"edgeType":"PROJECTION"},{"sources":[7],"targets":[1],"edgeType":"PROJECTION"},{"sources":[8],"targets":[2,3],"edgeType":"PROJECTION"},{"sources":[9],"targets":[4],"edgeType":"PROJECTION"},{"sources":[10],"targets":[5],"edgeType":"PROJECTION"},{"sources":[8,11],"targets":[0,1,2,3,4,5],"expression":"(e.emp_id is not null and e.dept_id is not null)","edgeType":"PREDICATE"},{"sources":[8],"targets":[0,1,2,3,4,5],"expression":"(emd:em:e.emp
 _id = emd:em:m.emp_id)","edgeType":"PREDICATE"},{"sources":[8],"targets":[0,1,2,3,4,5],"expression":"m.emp_id is not null","edgeType":"PREDICATE"},{"sources":[11,12,9],"targets":[0,1,2,3,4,5],"expression":"(emd:em:e.dept_id = emd:d.dept_id AND emd:em:e.dept_id = p.project_id)","edgeType":"PREDICATE"},{"sources":[12],"targets":[0,1,2,3,4,5],"expression":"d.dept_id is not null","edgeType":"PREDICATE"},{"sources":[9],"targets":[0,1,2,3,4,5],"expression":"p.project_id is not null","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.tgt.dept_name"},{"id":1,"vertexType":"COLUMN","vertexId":"default.tgt.name"},{"id":2,"vertexType":"COLUMN","vertexId":"default.tgt.emp_id"},{"id":3,"vertexType":"COLUMN","vertexId":"default.tgt.mgr_id"},{"id":4,"vertexType":"COLUMN","vertexId":"default.tgt.proj_id"},{"id":5,"vertexType":"COLUMN","vertexId":"default.tgt.proj_name"},{"id":6,"vertexType":"COLUMN","vertexId":"default.dept.dept_name"},{"id":7,"vertexType":"COLUMN
 ","vertexId":"default.emp.name"},{"id":8,"vertexType":"COLUMN","vertexId":"default.emp.emp_id"},{"id":9,"vertexType":"COLUMN","vertexId":"default.project.project_id"},{"id":10,"vertexType":"COLUMN","vertexId":"default.project.project_name"},{"id":11,"vertexType":"COLUMN","vertexId":"default.emp.dept_id"},{"id":12,"vertexType":"COLUMN","vertexId":"default.dept.dept_id"}]}
+PREHOOK: query: drop table if exists dest_l2
+PREHOOK: type: DROPTABLE
+PREHOOK: query: create table dest_l2 (id int, c1 tinyint, c2 int, c3 bigint) stored as textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@dest_l2
+PREHOOK: query: insert into dest_l2 values(0, 1, 100, 10000)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__1
+PREHOOK: Output: default@dest_l2
+{"version":"1.0","engine":"tez","database":"default","hash":"e001334e3f8384806b0f25a7c303045f","queryText":"insert into dest_l2 values(0, 1, 100, 10000)","edges":[{"sources":[],"targets":[0],"expression":"UDFToInteger(tmp_values_col1)","edgeType":"PROJECTION"},{"sources":[],"targets":[1],"expression":"UDFToByte(tmp_values_col2)","edgeType":"PROJECTION"},{"sources":[],"targets":[2],"expression":"UDFToInteger(tmp_values_col3)","edgeType":"PROJECTION"},{"sources":[],"targets":[3],"expression":"UDFToLong(tmp_values_col4)","edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.dest_l2.id"},{"id":1,"vertexType":"COLUMN","vertexId":"default.dest_l2.c1"},{"id":2,"vertexType":"COLUMN","vertexId":"default.dest_l2.c2"},{"id":3,"vertexType":"COLUMN","vertexId":"default.dest_l2.c3"}]}
+PREHOOK: query: select * from (
+  select c1 + c2 x from dest_l2
+  union all
+  select sum(c3) y from (select c3 from dest_l2) v1) v2 order by x
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_l2
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"a2c96a96be9d315ede966be5b45ef20e","queryText":"select * from (\n  select c1 + c2 x from dest_l2\n  union all\n  select sum(c3) y from (select c3 from dest_l2) v1) v2 order by x","edges":[{"sources":[1,2,3],"targets":[0],"expression":"KEY.reducesinkkey0","edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"v2.x"},{"id":1,"vertexType":"COLUMN","vertexId":"default.dest_l2.c1"},{"id":2,"vertexType":"COLUMN","vertexId":"default.dest_l2.c2"},{"id":3,"vertexType":"COLUMN","vertexId":"default.dest_l2.c3"}]}
+101
+10000
+PREHOOK: query: drop table if exists dest_l3
+PREHOOK: type: DROPTABLE
+PREHOOK: query: create table dest_l3 (id int, c1 string, c2 string, c3 int) stored as textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@dest_l3
+PREHOOK: query: insert into dest_l3 values(0, "s1", "s2", 15)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__2
+PREHOOK: Output: default@dest_l3
+{"version":"1.0","engine":"tez","database":"default","hash":"09df51ba6ba2d07f2304523ee505f094","queryText":"insert into dest_l3 values(0, \"s1\", \"s2\", 15)","edges":[{"sources":[],"targets":[0],"expression":"UDFToInteger(tmp_values_col1)","edgeType":"PROJECTION"},{"sources":[],"targets":[1,2],"edgeType":"PROJECTION"},{"sources":[],"targets":[3],"expression":"UDFToInteger(tmp_values_col4)","edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.dest_l3.id"},{"id":1,"vertexType":"COLUMN","vertexId":"default.dest_l3.c1"},{"id":2,"vertexType":"COLUMN","vertexId":"default.dest_l3.c2"},{"id":3,"vertexType":"COLUMN","vertexId":"default.dest_l3.c3"}]}
+PREHOOK: query: select sum(a.c1) over (partition by a.c1 order by a.id)
+from dest_l2 a
+where a.c2 != 10
+group by a.c1, a.c2, a.id
+having count(a.c2) > 0
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_l2
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"0ae7aa4a0cbd1283210fa79e8a19104a","queryText":"select sum(a.c1) over (partition by a.c1 order by a.id)\nfrom dest_l2 a\nwhere a.c2 != 10\ngroup by a.c1, a.c2, a.id\nhaving count(a.c2) > 0","edges":[{"sources":[1,2,3],"targets":[0],"expression":"$win$_col_0","edgeType":"PROJECTION"},{"sources":[2],"targets":[0],"expression":"(a.c2 <> 10)","edgeType":"PREDICATE"},{"sources":[2],"targets":[0],"expression":"(count(default.dest_l2.c2) > 0)","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"_c0"},{"id":1,"vertexType":"COLUMN","vertexId":"default.dest_l2.c1"},{"id":2,"vertexType":"COLUMN","vertexId":"default.dest_l2.c2"},{"id":3,"vertexType":"COLUMN","vertexId":"default.dest_l2.id"}]}
+1
+PREHOOK: query: select sum(a.c1), count(b.c1), b.c2, b.c3
+from dest_l2 a join dest_l3 b on (a.id = b.id)
+where a.c2 != 10 and b.c3 > 0
+group by a.c1, a.c2, a.id, b.c1, b.c2, b.c3
+having count(a.c2) > 0
+order by b.c3 limit 5
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_l2
+PREHOOK: Input: default@dest_l3
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"01879c619517509d9f5b6ead998bb4bb","queryText":"select sum(a.c1), count(b.c1), b.c2, b.c3\nfrom dest_l2 a join dest_l3 b on (a.id = b.id)\nwhere a.c2 != 10 and b.c3 > 0\ngroup by a.c1, a.c2, a.id, b.c1, b.c2, b.c3\nhaving count(a.c2) > 0\norder by b.c3 limit 5","edges":[{"sources":[4],"targets":[0],"expression":"sum(default.dest_l2.c1)","edgeType":"PROJECTION"},{"sources":[5],"targets":[1],"expression":"count(default.dest_l3.c1)","edgeType":"PROJECTION"},{"sources":[6],"targets":[2],"edgeType":"PROJECTION"},{"sources":[7],"targets":[3],"edgeType":"PROJECTION"},{"sources":[8,9],"targets":[0,1,2,3],"expression":"((a.c2 <> 10) and a.id is not null)","edgeType":"PREDICATE"},{"sources":[9,10],"targets":[0,1,2,3],"expression":"(a.id = b.id)","edgeType":"PREDICATE"},{"sources":[7,10],"targets":[0,1,2,3],"expression":"((b.c3 > 0) and b.id is not null)","edgeType":"PREDICATE"},{"sources":[8],"targets":[0,1,2,3],"expression":"(count(
 default.dest_l2.c2) > 0)","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"_c0"},{"id":1,"vertexType":"COLUMN","vertexId":"_c1"},{"id":2,"vertexType":"COLUMN","vertexId":"b.c2"},{"id":3,"vertexType":"COLUMN","vertexId":"b.c3"},{"id":4,"vertexType":"COLUMN","vertexId":"default.dest_l2.c1"},{"id":5,"vertexType":"COLUMN","vertexId":"default.dest_l3.c1"},{"id":6,"vertexType":"COLUMN","vertexId":"default.dest_l3.c2"},{"id":7,"vertexType":"COLUMN","vertexId":"default.dest_l3.c3"},{"id":8,"vertexType":"COLUMN","vertexId":"default.dest_l2.c2"},{"id":9,"vertexType":"COLUMN","vertexId":"default.dest_l2.id"},{"id":10,"vertexType":"COLUMN","vertexId":"default.dest_l3.id"}]}
+1	1	s2	15
+PREHOOK: query: drop table if exists t
+PREHOOK: type: DROPTABLE
+PREHOOK: query: create table t as
+select distinct a.c2, a.c3 from dest_l2 a
+inner join dest_l3 b on (a.id = b.id)
+where a.id > 0 and b.c3 = 15
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@dest_l2
+PREHOOK: Input: default@dest_l3
+PREHOOK: Output: database:default
+PREHOOK: Output: default@t
+{"version":"1.0","engine":"tez","database":"default","hash":"0d2f15b494111ffe236d5be42a76fa28","queryText":"create table t as\nselect distinct a.c2, a.c3 from dest_l2 a\ninner join dest_l3 b on (a.id = b.id)\nwhere a.id > 0 and b.c3 = 15","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"},{"sources":[4],"targets":[0,1],"expression":"(a.id > 0)","edgeType":"PREDICATE"},{"sources":[4,5],"targets":[0,1],"expression":"(a.id = b.id)","edgeType":"PREDICATE"},{"sources":[6,5],"targets":[0,1],"expression":"((b.c3 = 15) and (b.id > 0))","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.t.c2"},{"id":1,"vertexType":"COLUMN","vertexId":"default.t.c3"},{"id":2,"vertexType":"COLUMN","vertexId":"default.dest_l2.c2"},{"id":3,"vertexType":"COLUMN","vertexId":"default.dest_l2.c3"},{"id":4,"vertexType":"COLUMN","vertexId":"default.dest_l2.id"},{"id":5,"vertexType":"COLUMN","vertexId":"default.dest_l3
 .id"},{"id":6,"vertexType":"COLUMN","vertexId":"default.dest_l3.c3"}]}
+PREHOOK: query: SELECT substr(src1.key,1,1), count(DISTINCT substr(src1.value,5)),
+concat(substr(src1.key,1,1),sum(substr(src1.value,5)))
+from src1
+GROUP BY substr(src1.key,1,1)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src1
+#### A masked pattern was here ####
+{"version":"1.0","engine":"tez","database":"default","hash":"5b1022708124ee2b80f9e2e8a0dcb15c","queryText":"SELECT substr(src1.key,1,1), count(DISTINCT substr(src1.value,5)),\nconcat(substr(src1.key,1,1),sum(substr(src1.value,5)))\nfrom src1\nGROUP BY substr(src1.key,1,1)","edges":[{"sources":[3],"targets":[0],"expression":"substr(src1.key, 1, 1)","edgeType":"PROJECTION"},{"sources":[4],"targets":[1],"expression":"count(DISTINCT KEY._col1:0._col0)","edgeType":"PROJECTION"},{"sources":[3,5],"targets":[2],"expression":"concat(substr(src1.key, 1, 1), sum(substr(src1.value, 5)))","edgeType":"PROJECTION"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"_c0"},{"id":1,"vertexType":"COLUMN","vertexId":"_c1"},{"id":2,"vertexType":"COLUMN","vertexId":"_c2"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":4,"vertexType":"TABLE","vertexId":"default.src1"},{"id":5,"vertexType":"COLUMN","vertexId":"default.src1.value"}]}
+	7	1543.0
+1	3	1296.0
+2	6	21257.0
+3	2	3311.0
+4	2	4807.0
+6	1	666.0
+9	1	998.0

http://git-wip-us.apache.org/repos/asf/hive/blob/1f258e96/ql/src/test/results/clientpositive/llap/cbo_rp_semijoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/cbo_rp_semijoin.q.out b/ql/src/test/results/clientpositive/llap/cbo_rp_semijoin.q.out
new file mode 100644
index 0000000..bdd8125
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/cbo_rp_semijoin.q.out
@@ -0,0 +1,440 @@
+PREHOOK: query: -- 12. SemiJoin
+select cbo_t1.c_int           from cbo_t1 left semi join   cbo_t2 on cbo_t1.key=cbo_t2.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@cbo_t1
+PREHOOK: Input: default@cbo_t1@dt=2014
+PREHOOK: Input: default@cbo_t2
+PREHOOK: Input: default@cbo_t2@dt=2014
+#### A masked pattern was here ####
+POSTHOOK: query: -- 12. SemiJoin
+select cbo_t1.c_int           from cbo_t1 left semi join   cbo_t2 on cbo_t1.key=cbo_t2.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@cbo_t1
+POSTHOOK: Input: default@cbo_t1@dt=2014
+POSTHOOK: Input: default@cbo_t2
+POSTHOOK: Input: default@cbo_t2@dt=2014
+#### A masked pattern was here ####
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+PREHOOK: query: select cbo_t1.c_int           from cbo_t1 left semi join   cbo_t2 on cbo_t1.key=cbo_t2.key where (cbo_t1.c_int + 1 == 2) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@cbo_t1
+PREHOOK: Input: default@cbo_t1@dt=2014
+PREHOOK: Input: default@cbo_t2
+PREHOOK: Input: default@cbo_t2@dt=2014
+#### A masked pattern was here ####
+POSTHOOK: query: select cbo_t1.c_int           from cbo_t1 left semi join   cbo_t2 on cbo_t1.key=cbo_t2.key where (cbo_t1.c_int + 1 == 2) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@cbo_t1
+POSTHOOK: Input: default@cbo_t1@dt=2014
+POSTHOOK: Input: default@cbo_t2
+POSTHOOK: Input: default@cbo_t2@dt=2014
+#### A masked pattern was here ####
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+PREHOOK: query: select * from (select c, b, a from (select key as a, c_int as b, cbo_t1.c_float as c from cbo_t1  where (cbo_t1.c_int + 1 == 2) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)) cbo_t1 left semi join (select cbo_t2.key as p, cbo_t2.c_int as q, c_float as r from cbo_t2  where (cbo_t2.c_int + 1 == 2) and (cbo_t2.c_int > 0 or cbo_t2.c_float >= 0)) cbo_t2 on cbo_t1.a=p left semi join cbo_t3 on cbo_t1.a=key where (b + 1 == 2) and (b > 0 or c >= 0)) R where  (b + 1 = 2) and (R.b > 0 or c >= 0)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@cbo_t1
+PREHOOK: Input: default@cbo_t1@dt=2014
+PREHOOK: Input: default@cbo_t2
+PREHOOK: Input: default@cbo_t2@dt=2014
+PREHOOK: Input: default@cbo_t3
+#### A masked pattern was here ####
+POSTHOOK: query: select * from (select c, b, a from (select key as a, c_int as b, cbo_t1.c_float as c from cbo_t1  where (cbo_t1.c_int + 1 == 2) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)) cbo_t1 left semi join (select cbo_t2.key as p, cbo_t2.c_int as q, c_float as r from cbo_t2  where (cbo_t2.c_int + 1 == 2) and (cbo_t2.c_int > 0 or cbo_t2.c_float >= 0)) cbo_t2 on cbo_t1.a=p left semi join cbo_t3 on cbo_t1.a=key where (b + 1 == 2) and (b > 0 or c >= 0)) R where  (b + 1 = 2) and (R.b > 0 or c >= 0)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@cbo_t1
+POSTHOOK: Input: default@cbo_t1@dt=2014
+POSTHOOK: Input: default@cbo_t2
+POSTHOOK: Input: default@cbo_t2@dt=2014
+POSTHOOK: Input: default@cbo_t3
+#### A masked pattern was here ####
+1.0	1	 1
+1.0	1	 1
+1.0	1	 1 
+1.0	1	 1 
+1.0	1	1
+1.0	1	1
+1.0	1	1
+1.0	1	1
+1.0	1	1
+1.0	1	1
+1.0	1	1
+1.0	1	1
+1.0	1	1
+1.0	1	1
+1.0	1	1
+1.0	1	1
+1.0	1	1 
+1.0	1	1 
+PREHOOK: query: select * from (select cbo_t3.c_int, cbo_t1.c, b from (select key as a, c_int as b, cbo_t1.c_float as c from cbo_t1  where (cbo_t1.c_int + 1 = 2) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)) cbo_t1 left semi join (select cbo_t2.key as p, cbo_t2.c_int as q, c_float as r from cbo_t2  where (cbo_t2.c_int + 1 == 2) and (cbo_t2.c_int > 0 or cbo_t2.c_float >= 0)) cbo_t2 on cbo_t1.a=p left outer join cbo_t3 on cbo_t1.a=key where (b + cbo_t3.c_int  == 2) and (b > 0 or c_int >= 0)) R where  (R.c_int + 1 = 2) and (R.b > 0 or c_int >= 0)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@cbo_t1
+PREHOOK: Input: default@cbo_t1@dt=2014
+PREHOOK: Input: default@cbo_t2
+PREHOOK: Input: default@cbo_t2@dt=2014
+PREHOOK: Input: default@cbo_t3
+#### A masked pattern was here ####
+POSTHOOK: query: select * from (select cbo_t3.c_int, cbo_t1.c, b from (select key as a, c_int as b, cbo_t1.c_float as c from cbo_t1  where (cbo_t1.c_int + 1 = 2) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)) cbo_t1 left semi join (select cbo_t2.key as p, cbo_t2.c_int as q, c_float as r from cbo_t2  where (cbo_t2.c_int + 1 == 2) and (cbo_t2.c_int > 0 or cbo_t2.c_float >= 0)) cbo_t2 on cbo_t1.a=p left outer join cbo_t3 on cbo_t1.a=key where (b + cbo_t3.c_int  == 2) and (b > 0 or c_int >= 0)) R where  (R.c_int + 1 = 2) and (R.b > 0 or c_int >= 0)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@cbo_t1
+POSTHOOK: Input: default@cbo_t1@dt=2014
+POSTHOOK: Input: default@cbo_t2
+POSTHOOK: Input: default@cbo_t2@dt=2014
+POSTHOOK: Input: default@cbo_t3
+#### A masked pattern was here ####
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+1	1.0	1
+PREHOOK: query: select * from (select c_int, b, cbo_t1.c from (select key as a, c_int as b, cbo_t1.c_float as c from cbo_t1  where (cbo_t1.c_int + 1 == 2) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)) cbo_t1 left semi join (select cbo_t2.key as p, cbo_t2.c_int as q, c_float as r from cbo_t2  where (cbo_t2.c_int + 1 == 2) and (cbo_t2.c_int > 0 or cbo_t2.c_float >= 0)) cbo_t2 on cbo_t1.a=p right outer join cbo_t3 on cbo_t1.a=key where (b + 1 == 2) and (b > 0 or c_int >= 0)) R where  (c + 1 = 2) and (R.b > 0 or c_int >= 0)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@cbo_t1
+PREHOOK: Input: default@cbo_t1@dt=2014
+PREHOOK: Input: default@cbo_t2
+PREHOOK: Input: default@cbo_t2@dt=2014
+PREHOOK: Input: default@cbo_t3
+#### A masked pattern was here ####
+POSTHOOK: query: select * from (select c_int, b, cbo_t1.c from (select key as a, c_int as b, cbo_t1.c_float as c from cbo_t1  where (cbo_t1.c_int + 1 == 2) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)) cbo_t1 left semi join (select cbo_t2.key as p, cbo_t2.c_int as q, c_float as r from cbo_t2  where (cbo_t2.c_int + 1 == 2) and (cbo_t2.c_int > 0 or cbo_t2.c_float >= 0)) cbo_t2 on cbo_t1.a=p right outer join cbo_t3 on cbo_t1.a=key where (b + 1 == 2) and (b > 0 or c_int >= 0)) R where  (c + 1 = 2) and (R.b > 0 or c_int >= 0)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@cbo_t1
+POSTHOOK: Input: default@cbo_t1@dt=2014
+POSTHOOK: Input: default@cbo_t2
+POSTHOOK: Input: default@cbo_t2@dt=2014
+POSTHOOK: Input: default@cbo_t3
+#### A masked pattern was here ####
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+PREHOOK: query: select * from (select c_int, b, cbo_t1.c from (select key as a, c_int as b, cbo_t1.c_float as c from cbo_t1  where (cbo_t1.c_int + 1 == 2) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)) cbo_t1 left semi join (select cbo_t2.key as p, cbo_t2.c_int as q, c_float as r from cbo_t2  where (cbo_t2.c_int + 1 == 2) and (cbo_t2.c_int > 0 or cbo_t2.c_float >= 0)) cbo_t2 on cbo_t1.a=p full outer join cbo_t3 on cbo_t1.a=key where (b + 1 == 2) and (b > 0 or c_int >= 0)) R where  (c + 1 = 2) and (R.b > 0 or c_int >= 0)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@cbo_t1
+PREHOOK: Input: default@cbo_t1@dt=2014
+PREHOOK: Input: default@cbo_t2
+PREHOOK: Input: default@cbo_t2@dt=2014
+PREHOOK: Input: default@cbo_t3
+#### A masked pattern was here ####
+POSTHOOK: query: select * from (select c_int, b, cbo_t1.c from (select key as a, c_int as b, cbo_t1.c_float as c from cbo_t1  where (cbo_t1.c_int + 1 == 2) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)) cbo_t1 left semi join (select cbo_t2.key as p, cbo_t2.c_int as q, c_float as r from cbo_t2  where (cbo_t2.c_int + 1 == 2) and (cbo_t2.c_int > 0 or cbo_t2.c_float >= 0)) cbo_t2 on cbo_t1.a=p full outer join cbo_t3 on cbo_t1.a=key where (b + 1 == 2) and (b > 0 or c_int >= 0)) R where  (c + 1 = 2) and (R.b > 0 or c_int >= 0)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@cbo_t1
+POSTHOOK: Input: default@cbo_t1@dt=2014
+POSTHOOK: Input: default@cbo_t2
+POSTHOOK: Input: default@cbo_t2@dt=2014
+POSTHOOK: Input: default@cbo_t3
+#### A masked pattern was here ####
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+1	1	1.0
+PREHOOK: query: select a, c, count(*) from (select key as a, c_int+1 as b, sum(c_int) as c from cbo_t1 where (cbo_t1.c_int + 1 >= 0) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)  group by c_float, cbo_t1.c_int, key having cbo_t1.c_float > 0 and (c_int >=1 or c_float >= 1) and (c_int + c_float) >= 0 order by a+b desc, c asc) cbo_t1 left semi join (select key as p, c_int+1 as q, sum(c_int) as r from cbo_t2 where (cbo_t2.c_int + 1 >= 0) and (cbo_t2.c_int > 0 or cbo_t2.c_float >= 0)  group by c_float, cbo_t2.c_int, key having cbo_t2.c_float > 0 and (c_int >=1 or c_float >= 1) and (c_int + c_float) >= 0 order by q+r/10 desc, p) cbo_t2 on cbo_t1.a=p left semi join cbo_t3 on cbo_t1.a=key where (b + 1  >= 0) and (b > 0 or a >= 0) group by a, c  having a > 0 and (a >=1 or c >= 1) and (a + c) >= 0 order by c, a
+PREHOOK: type: QUERY
+PREHOOK: Input: default@cbo_t1
+PREHOOK: Input: default@cbo_t1@dt=2014
+PREHOOK: Input: default@cbo_t2
+PREHOOK: Input: default@cbo_t2@dt=2014
+PREHOOK: Input: default@cbo_t3
+#### A masked pattern was here ####
+POSTHOOK: query: select a, c, count(*) from (select key as a, c_int+1 as b, sum(c_int) as c from cbo_t1 where (cbo_t1.c_int + 1 >= 0) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)  group by c_float, cbo_t1.c_int, key having cbo_t1.c_float > 0 and (c_int >=1 or c_float >= 1) and (c_int + c_float) >= 0 order by a+b desc, c asc) cbo_t1 left semi join (select key as p, c_int+1 as q, sum(c_int) as r from cbo_t2 where (cbo_t2.c_int + 1 >= 0) and (cbo_t2.c_int > 0 or cbo_t2.c_float >= 0)  group by c_float, cbo_t2.c_int, key having cbo_t2.c_float > 0 and (c_int >=1 or c_float >= 1) and (c_int + c_float) >= 0 order by q+r/10 desc, p) cbo_t2 on cbo_t1.a=p left semi join cbo_t3 on cbo_t1.a=key where (b + 1  >= 0) and (b > 0 or a >= 0) group by a, c  having a > 0 and (a >=1 or c >= 1) and (a + c) >= 0 order by c, a
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@cbo_t1
+POSTHOOK: Input: default@cbo_t1@dt=2014
+POSTHOOK: Input: default@cbo_t2
+POSTHOOK: Input: default@cbo_t2@dt=2014
+POSTHOOK: Input: default@cbo_t3
+#### A masked pattern was here ####
+ 1	2	1
+ 1 	2	1
+1 	2	1
+1	12	1
+PREHOOK: query: select a, c, count(*)  from (select key as a, c_int+1 as b, sum(c_int) as c from cbo_t1 where (cbo_t1.c_int + 1 >= 0) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)  group by c_float, cbo_t1.c_int, key having cbo_t1.c_float > 0 and (c_int >=1 or c_float >= 1) and (c_int + c_float) >= 0 order by a+b desc, c asc limit 5) cbo_t1 left semi join (select key as p, c_int+1 as q, sum(c_int) as r from cbo_t2 where (cbo_t2.c_int + 1 >= 0) and (cbo_t2.c_int > 0 or cbo_t2.c_float >= 0)  group by c_float, cbo_t2.c_int, key having cbo_t2.c_float > 0 and (c_int >=1 or c_float >= 1) and (c_int + c_float) >= 0 order by q+r/10 desc, p limit 5) cbo_t2 on cbo_t1.a=p left semi join cbo_t3 on cbo_t1.a=key where (b + 1  >= 0) and (b > 0 or a >= 0) group by a, c  having a > 0 and (a >=1 or c >= 1) and (a + c) >= 0 order by c, a
+PREHOOK: type: QUERY
+PREHOOK: Input: default@cbo_t1
+PREHOOK: Input: default@cbo_t1@dt=2014
+PREHOOK: Input: default@cbo_t2
+PREHOOK: Input: default@cbo_t2@dt=2014
+PREHOOK: Input: default@cbo_t3
+#### A masked pattern was here ####
+POSTHOOK: query: select a, c, count(*)  from (select key as a, c_int+1 as b, sum(c_int) as c from cbo_t1 where (cbo_t1.c_int + 1 >= 0) and (cbo_t1.c_int > 0 or cbo_t1.c_float >= 0)  group by c_float, cbo_t1.c_int, key having cbo_t1.c_float > 0 and (c_int >=1 or c_float >= 1) and (c_int + c_float) >= 0 order by a+b desc, c asc limit 5) cbo_t1 left semi join (select key as p, c_int+1 as q, sum(c_int) as r from cbo_t2 where (cbo_t2.c_int + 1 >= 0) and (cbo_t2.c_int > 0 or cbo_t2.c_float >= 0)  group by c_float, cbo_t2.c_int, key having cbo_t2.c_float > 0 and (c_int >=1 or c_float >= 1) and (c_int + c_float) >= 0 order by q+r/10 desc, p limit 5) cbo_t2 on cbo_t1.a=p left semi join cbo_t3 on cbo_t1.a=key where (b + 1  >= 0) and (b > 0 or a >= 0) group by a, c  having a > 0 and (a >=1 or c >= 1) and (a + c) >= 0 order by c, a
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@cbo_t1
+POSTHOOK: Input: default@cbo_t1@dt=2014
+POSTHOOK: Input: default@cbo_t2
+POSTHOOK: Input: default@cbo_t2@dt=2014
+POSTHOOK: Input: default@cbo_t3
+#### A masked pattern was here ####
+ 1	2	1
+ 1 	2	1
+1 	2	1
+1	12	1

http://git-wip-us.apache.org/repos/asf/hive/blob/1f258e96/ql/src/test/results/clientpositive/llap/cbo_rp_subq_not_in.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/cbo_rp_subq_not_in.q.out b/ql/src/test/results/clientpositive/llap/cbo_rp_subq_not_in.q.out
new file mode 100644
index 0000000..c7274f7
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/cbo_rp_subq_not_in.q.out
@@ -0,0 +1,365 @@
+PREHOOK: query: -- 16. SubQueries Not In
+-- non agg, non corr
+select * 
+from src_cbo 
+where src_cbo.key not in  
+  ( select key  from src_cbo s1 
+    where s1.key > '2'
+  ) order by key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_cbo
+#### A masked pattern was here ####
+POSTHOOK: query: -- 16. SubQueries Not In
+-- non agg, non corr
+select * 
+from src_cbo 
+where src_cbo.key not in  
+  ( select key  from src_cbo s1 
+    where s1.key > '2'
+  ) order by key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_cbo
+#### A masked pattern was here ####
+0	val_0
+0	val_0
+0	val_0
+10	val_10
+100	val_100
+100	val_100
+103	val_103
+103	val_103
+104	val_104
+104	val_104
+105	val_105
+11	val_11
+111	val_111
+113	val_113
+113	val_113
+114	val_114
+116	val_116
+118	val_118
+118	val_118
+119	val_119
+119	val_119
+119	val_119
+12	val_12
+12	val_12
+120	val_120
+120	val_120
+125	val_125
+125	val_125
+126	val_126
+128	val_128
+128	val_128
+128	val_128
+129	val_129
+129	val_129
+131	val_131
+133	val_133
+134	val_134
+134	val_134
+136	val_136
+137	val_137
+137	val_137
+138	val_138
+138	val_138
+138	val_138
+138	val_138
+143	val_143
+145	val_145
+146	val_146
+146	val_146
+149	val_149
+149	val_149
+15	val_15
+15	val_15
+150	val_150
+152	val_152
+152	val_152
+153	val_153
+155	val_155
+156	val_156
+157	val_157
+158	val_158
+160	val_160
+162	val_162
+163	val_163
+164	val_164
+164	val_164
+165	val_165
+165	val_165
+166	val_166
+167	val_167
+167	val_167
+167	val_167
+168	val_168
+169	val_169
+169	val_169
+169	val_169
+169	val_169
+17	val_17
+170	val_170
+172	val_172
+172	val_172
+174	val_174
+174	val_174
+175	val_175
+175	val_175
+176	val_176
+176	val_176
+177	val_177
+178	val_178
+179	val_179
+179	val_179
+18	val_18
+18	val_18
+180	val_180
+181	val_181
+183	val_183
+186	val_186
+187	val_187
+187	val_187
+187	val_187
+189	val_189
+19	val_19
+190	val_190
+191	val_191
+191	val_191
+192	val_192
+193	val_193
+193	val_193
+193	val_193
+194	val_194
+195	val_195
+195	val_195
+196	val_196
+197	val_197
+197	val_197
+199	val_199
+199	val_199
+199	val_199
+2	val_2
+PREHOOK: query: -- non agg, corr
+select p_mfgr, b.p_name, p_size 
+from part b 
+where b.p_name not in 
+  (select p_name 
+  from (select p_mfgr, p_name, p_size as r from part) a 
+  where r < 10 and b.p_mfgr = a.p_mfgr 
+  ) order by p_mfgr,p_size
+PREHOOK: type: QUERY
+PREHOOK: Input: default@part
+#### A masked pattern was here ####
+POSTHOOK: query: -- non agg, corr
+select p_mfgr, b.p_name, p_size 
+from part b 
+where b.p_name not in 
+  (select p_name 
+  from (select p_mfgr, p_name, p_size as r from part) a 
+  where r < 10 and b.p_mfgr = a.p_mfgr 
+  ) order by p_mfgr,p_size
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@part
+#### A masked pattern was here ####
+Manufacturer#1	almond aquamarine burnished black steel	28
+Manufacturer#1	almond antique chartreuse lavender yellow	34
+Manufacturer#1	almond aquamarine pink moccasin thistle	42
+Manufacturer#2	almond antique violet chocolate turquoise	14
+Manufacturer#2	almond aquamarine sandy cyan gainsboro	18
+Manufacturer#2	almond aquamarine rose maroon antique	25
+Manufacturer#2	almond antique violet turquoise frosted	40
+Manufacturer#3	almond antique forest lavender goldenrod	14
+Manufacturer#3	almond antique chartreuse khaki white	17
+Manufacturer#3	almond antique metallic orange dim	19
+Manufacturer#3	almond antique olive coral navajo	45
+Manufacturer#4	almond antique gainsboro frosted violet	10
+Manufacturer#4	almond azure aquamarine papaya violet	12
+Manufacturer#4	almond aquamarine floral ivory bisque	27
+Manufacturer#4	almond antique violet mint lemon	39
+Manufacturer#5	almond azure blanched chiffon midnight	23
+Manufacturer#5	almond antique blue firebrick mint	31
+Manufacturer#5	almond aquamarine dodger light gainsboro	46
+PREHOOK: query: -- agg, non corr
+select p_name, p_size 
+from 
+part where part.p_size not in 
+  (select avg(p_size) 
+  from (select p_size from part) a 
+  where p_size < 10
+  ) order by p_name
+PREHOOK: type: QUERY
+PREHOOK: Input: default@part
+#### A masked pattern was here ####
+POSTHOOK: query: -- agg, non corr
+select p_name, p_size 
+from 
+part where part.p_size not in 
+  (select avg(p_size) 
+  from (select p_size from part) a 
+  where p_size < 10
+  ) order by p_name
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@part
+#### A masked pattern was here ####
+almond antique blue firebrick mint	31
+almond antique burnished rose metallic	2
+almond antique burnished rose metallic	2
+almond antique chartreuse khaki white	17
+almond antique chartreuse lavender yellow	34
+almond antique forest lavender goldenrod	14
+almond antique gainsboro frosted violet	10
+almond antique medium spring khaki	6
+almond antique metallic orange dim	19
+almond antique misty red olive	1
+almond antique olive coral navajo	45
+almond antique salmon chartreuse burlywood	6
+almond antique sky peru orange	2
+almond antique violet chocolate turquoise	14
+almond antique violet mint lemon	39
+almond antique violet turquoise frosted	40
+almond aquamarine burnished black steel	28
+almond aquamarine dodger light gainsboro	46
+almond aquamarine floral ivory bisque	27
+almond aquamarine midnight light salmon	2
+almond aquamarine pink moccasin thistle	42
+almond aquamarine rose maroon antique	25
+almond aquamarine sandy cyan gainsboro	18
+almond aquamarine yellow dodger mint	7
+almond azure aquamarine papaya violet	12
+almond azure blanched chiffon midnight	23
+PREHOOK: query: -- agg, corr
+select p_mfgr, p_name, p_size 
+from part b where b.p_size not in 
+  (select min(p_size) 
+  from (select p_mfgr, p_size from part) a 
+  where p_size < 10 and b.p_mfgr = a.p_mfgr
+  ) order by  p_name
+PREHOOK: type: QUERY
+PREHOOK: Input: default@part
+#### A masked pattern was here ####
+POSTHOOK: query: -- agg, corr
+select p_mfgr, p_name, p_size 
+from part b where b.p_size not in 
+  (select min(p_size) 
+  from (select p_mfgr, p_size from part) a 
+  where p_size < 10 and b.p_mfgr = a.p_mfgr
+  ) order by  p_name
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@part
+#### A masked pattern was here ####
+Manufacturer#5	almond antique blue firebrick mint	31
+Manufacturer#3	almond antique chartreuse khaki white	17
+Manufacturer#1	almond antique chartreuse lavender yellow	34
+Manufacturer#3	almond antique forest lavender goldenrod	14
+Manufacturer#4	almond antique gainsboro frosted violet	10
+Manufacturer#5	almond antique medium spring khaki	6
+Manufacturer#3	almond antique metallic orange dim	19
+Manufacturer#3	almond antique olive coral navajo	45
+Manufacturer#1	almond antique salmon chartreuse burlywood	6
+Manufacturer#2	almond antique violet chocolate turquoise	14
+Manufacturer#4	almond antique violet mint lemon	39
+Manufacturer#2	almond antique violet turquoise frosted	40
+Manufacturer#1	almond aquamarine burnished black steel	28
+Manufacturer#5	almond aquamarine dodger light gainsboro	46
+Manufacturer#4	almond aquamarine floral ivory bisque	27
+Manufacturer#1	almond aquamarine pink moccasin thistle	42
+Manufacturer#2	almond aquamarine rose maroon antique	25
+Manufacturer#2	almond aquamarine sandy cyan gainsboro	18
+Manufacturer#4	almond azure aquamarine papaya violet	12
+Manufacturer#5	almond azure blanched chiffon midnight	23
+PREHOOK: query: -- non agg, non corr, Group By in Parent Query
+select li.l_partkey, count(*) 
+from lineitem li 
+where li.l_linenumber = 1 and 
+  li.l_orderkey not in (select l_orderkey from lineitem where l_shipmode = 'AIR') 
+group by li.l_partkey order by li.l_partkey
+PREHOOK: type: QUERY
+PREHOOK: Input: default@lineitem
+#### A masked pattern was here ####
+POSTHOOK: query: -- non agg, non corr, Group By in Parent Query
+select li.l_partkey, count(*) 
+from lineitem li 
+where li.l_linenumber = 1 and 
+  li.l_orderkey not in (select l_orderkey from lineitem where l_shipmode = 'AIR') 
+group by li.l_partkey order by li.l_partkey
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@lineitem
+#### A masked pattern was here ####
+450	1
+7068	1
+21636	1
+22630	1
+59694	1
+61931	1
+85951	1
+88035	1
+88362	1
+106170	1
+119477	1
+119767	1
+123076	1
+139636	1
+175839	1
+182052	1
+PREHOOK: query: -- add null check test from sq_notin.q once HIVE-7721 resolved.
+
+-- non agg, corr, having
+select b.p_mfgr, min(p_retailprice) 
+from part b 
+group by b.p_mfgr
+having b.p_mfgr not in 
+  (select p_mfgr 
+  from (select p_mfgr, min(p_retailprice) l, max(p_retailprice) r, avg(p_retailprice) a from part group by p_mfgr) a 
+  where min(p_retailprice) = l and r - l > 600
+  )
+  order by b.p_mfgr
+PREHOOK: type: QUERY
+PREHOOK: Input: default@part
+#### A masked pattern was here ####
+POSTHOOK: query: -- add null check test from sq_notin.q once HIVE-7721 resolved.
+
+-- non agg, corr, having
+select b.p_mfgr, min(p_retailprice) 
+from part b 
+group by b.p_mfgr
+having b.p_mfgr not in 
+  (select p_mfgr 
+  from (select p_mfgr, min(p_retailprice) l, max(p_retailprice) r, avg(p_retailprice) a from part group by p_mfgr) a 
+  where min(p_retailprice) = l and r - l > 600
+  )
+  order by b.p_mfgr
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@part
+#### A masked pattern was here ####
+Manufacturer#1	1173.15
+Manufacturer#2	1690.68
+PREHOOK: query: -- agg, non corr, having
+select b.p_mfgr, min(p_retailprice) 
+from part b 
+group by b.p_mfgr
+having b.p_mfgr not in 
+  (select p_mfgr 
+  from part a
+  group by p_mfgr
+  having max(p_retailprice) - min(p_retailprice) > 600
+  )
+  order by b.p_mfgr
+PREHOOK: type: QUERY
+PREHOOK: Input: default@part
+#### A masked pattern was here ####
+POSTHOOK: query: -- agg, non corr, having
+select b.p_mfgr, min(p_retailprice) 
+from part b 
+group by b.p_mfgr
+having b.p_mfgr not in 
+  (select p_mfgr 
+  from part a
+  group by p_mfgr
+  having max(p_retailprice) - min(p_retailprice) > 600
+  )
+  order by b.p_mfgr
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@part
+#### A masked pattern was here ####
+Manufacturer#1	1173.15
+Manufacturer#2	1690.68

http://git-wip-us.apache.org/repos/asf/hive/blob/1f258e96/ql/src/test/results/clientpositive/llap/cbo_rp_unionDistinct_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/cbo_rp_unionDistinct_2.q.out b/ql/src/test/results/clientpositive/llap/cbo_rp_unionDistinct_2.q.out
new file mode 100644
index 0000000..304d74f
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/cbo_rp_unionDistinct_2.q.out
@@ -0,0 +1,551 @@
+PREHOOK: query: -- SORT_QUERY_RESULTS
+
+CREATE TABLE u1 as select key, value from src order by key limit 5
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src
+PREHOOK: Output: database:default
+PREHOOK: Output: default@u1
+POSTHOOK: query: -- SORT_QUERY_RESULTS
+
+CREATE TABLE u1 as select key, value from src order by key limit 5
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@src
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@u1
+POSTHOOK: Lineage: u1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: u1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+PREHOOK: query: CREATE TABLE u2 as select key, value from src order by key limit 3
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src
+PREHOOK: Output: database:default
+PREHOOK: Output: default@u2
+POSTHOOK: query: CREATE TABLE u2 as select key, value from src order by key limit 3
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@src
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@u2
+POSTHOOK: Lineage: u2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: u2.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+PREHOOK: query: CREATE TABLE u3 as select key, value from src order by key desc limit 5
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src
+PREHOOK: Output: database:default
+PREHOOK: Output: default@u3
+POSTHOOK: query: CREATE TABLE u3 as select key, value from src order by key desc limit 5
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@src
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@u3
+POSTHOOK: Lineage: u3.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: u3.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+PREHOOK: query: select * from u1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+#### A masked pattern was here ####
+POSTHOOK: query: select * from u1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+#### A masked pattern was here ####
+0	val_0
+0	val_0
+0	val_0
+10	val_10
+100	val_100
+PREHOOK: query: select * from u2
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u2
+#### A masked pattern was here ####
+POSTHOOK: query: select * from u2
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u2
+#### A masked pattern was here ####
+0	val_0
+0	val_0
+0	val_0
+PREHOOK: query: select * from u3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select * from u3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+96	val_96
+97	val_97
+97	val_97
+98	val_98
+98	val_98
+PREHOOK: query: select key, value from 
+(
+select key, value from u1
+union all
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select key, value from 
+(
+select key, value from u1
+union all
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+0	val_0
+0	val_0
+0	val_0
+0	val_0
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+97	val_97
+98	val_98
+98	val_98
+PREHOOK: query: select key, value from 
+(
+select key, value from u1
+union 
+select key, value from u2
+union all
+select key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select key, value from 
+(
+select key, value from u1
+union 
+select key, value from u2
+union all
+select key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+97	val_97
+98	val_98
+98	val_98
+PREHOOK: query: select key, value from 
+(
+select key, value from u1
+union distinct
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select key, value from 
+(
+select key, value from u1
+union distinct
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+97	val_97
+98	val_98
+98	val_98
+PREHOOK: query: select key, value from 
+(
+select key, value from u1
+union all
+select key, value from u2
+union
+select key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select key, value from 
+(
+select key, value from u1
+union all
+select key, value from u2
+union
+select key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+98	val_98
+PREHOOK: query: select key, value from 
+(
+select key, value from u1
+union 
+select key, value from u2
+union
+select key as key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select key, value from 
+(
+select key, value from u1
+union 
+select key, value from u2
+union
+select key as key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+98	val_98
+PREHOOK: query: select distinct * from 
+(
+select key, value from u1
+union all 
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select distinct * from 
+(
+select key, value from u1
+union all 
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+98	val_98
+PREHOOK: query: select distinct * from 
+(
+select distinct * from u1
+union  
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select distinct * from 
+(
+select distinct * from u1
+union  
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+98	val_98
+PREHOOK: query: drop view if exists v
+PREHOOK: type: DROPVIEW
+POSTHOOK: query: drop view if exists v
+POSTHOOK: type: DROPVIEW
+PREHOOK: query: create view v as select distinct * from 
+(
+select distinct * from u1
+union  
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+PREHOOK: type: CREATEVIEW
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+PREHOOK: Output: database:default
+PREHOOK: Output: default@v
+POSTHOOK: query: create view v as select distinct * from 
+(
+select distinct * from u1
+union  
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@v
+PREHOOK: query: describe extended v
+PREHOOK: type: DESCTABLE
+PREHOOK: Input: default@v
+POSTHOOK: query: describe extended v
+POSTHOOK: type: DESCTABLE
+POSTHOOK: Input: default@v
+key                 	string              	                    
+value               	string              	                    
+	 	 
+#### A masked pattern was here ####
+(	 	 
+select distinct * from u1	 	 
+union  	 	 
+select key, value from u2	 	 
+union all	 	 
+select key as key, value from u3	 	 
+) tab, viewExpandedText:select distinct `tab`.`key`, `tab`.`value` from 	 	 
+(	 	 
+select distinct `u1`.`key`, `u1`.`value` from `default`.`u1`	 	 
+union  	 	 
+select `u2`.`key`, `u2`.`value` from `default`.`u2`	 	 
+union all	 	 
+select `u3`.`key` as `key`, `u3`.`value` from `default`.`u3`	 	 
+) `tab`, tableType:VIRTUAL_VIEW)		 
+PREHOOK: query: select * from v
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+PREHOOK: Input: default@v
+#### A masked pattern was here ####
+POSTHOOK: query: select * from v
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+POSTHOOK: Input: default@v
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+98	val_98
+PREHOOK: query: drop view if exists v
+PREHOOK: type: DROPVIEW
+PREHOOK: Input: default@v
+PREHOOK: Output: default@v
+POSTHOOK: query: drop view if exists v
+POSTHOOK: type: DROPVIEW
+POSTHOOK: Input: default@v
+POSTHOOK: Output: default@v
+PREHOOK: query: create view v as select tab.* from 
+(
+select distinct * from u1
+union  
+select distinct * from u2
+) tab
+PREHOOK: type: CREATEVIEW
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Output: database:default
+PREHOOK: Output: default@v
+POSTHOOK: query: create view v as select tab.* from 
+(
+select distinct * from u1
+union  
+select distinct * from u2
+) tab
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@v
+PREHOOK: query: describe extended v
+PREHOOK: type: DESCTABLE
+PREHOOK: Input: default@v
+POSTHOOK: query: describe extended v
+POSTHOOK: type: DESCTABLE
+POSTHOOK: Input: default@v
+key                 	string              	                    
+value               	string              	                    
+	 	 
+#### A masked pattern was here ####
+(	 	 
+select distinct * from u1	 	 
+union  	 	 
+select distinct * from u2	 	 
+) tab, viewExpandedText:select `tab`.`key`, `tab`.`value` from 	 	 
+(	 	 
+select distinct `u1`.`key`, `u1`.`value` from `default`.`u1`	 	 
+union  	 	 
+select distinct `u2`.`key`, `u2`.`value` from `default`.`u2`	 	 
+) `tab`, tableType:VIRTUAL_VIEW)		 
+PREHOOK: query: select * from v
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@v
+#### A masked pattern was here ####
+POSTHOOK: query: select * from v
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@v
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+PREHOOK: query: drop view if exists v
+PREHOOK: type: DROPVIEW
+PREHOOK: Input: default@v
+PREHOOK: Output: default@v
+POSTHOOK: query: drop view if exists v
+POSTHOOK: type: DROPVIEW
+POSTHOOK: Input: default@v
+POSTHOOK: Output: default@v
+PREHOOK: query: create view v as select * from 
+(
+select distinct u1.* from u1
+union all 
+select distinct * from u2
+) tab
+PREHOOK: type: CREATEVIEW
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Output: database:default
+PREHOOK: Output: default@v
+POSTHOOK: query: create view v as select * from 
+(
+select distinct u1.* from u1
+union all 
+select distinct * from u2
+) tab
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@v
+PREHOOK: query: describe extended v
+PREHOOK: type: DESCTABLE
+PREHOOK: Input: default@v
+POSTHOOK: query: describe extended v
+POSTHOOK: type: DESCTABLE
+POSTHOOK: Input: default@v
+key                 	string              	                    
+value               	string              	                    
+	 	 
+#### A masked pattern was here ####
+(	 	 
+select distinct u1.* from u1	 	 
+union all 	 	 
+select distinct * from u2	 	 
+) tab, viewExpandedText:select `tab`.`key`, `tab`.`value` from 	 	 
+(	 	 
+select distinct `u1`.`key`, `u1`.`value` from `default`.`u1`	 	 
+union all 	 	 
+select distinct `u2`.`key`, `u2`.`value` from `default`.`u2`	 	 
+) `tab`, tableType:VIRTUAL_VIEW)		 
+PREHOOK: query: select * from v
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@v
+#### A masked pattern was here ####
+POSTHOOK: query: select * from v
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@v
+#### A masked pattern was here ####
+0	val_0
+0	val_0
+10	val_10
+100	val_100
+PREHOOK: query: select distinct * from 
+(
+select key, value from u1
+union all 
+select key, value from u2
+union 
+select key as key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select distinct * from 
+(
+select key, value from u1
+union all 
+select key, value from u2
+union 
+select key as key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+98	val_98