http://git-wip-us.apache.org/repos/asf/hive/blob/1f258e96/ql/src/test/results/clientpositive/llap/insert_into_with_schema.q.out
----------------------------------------------------------------------
diff --git 
a/ql/src/test/results/clientpositive/llap/insert_into_with_schema.q.out 
b/ql/src/test/results/clientpositive/llap/insert_into_with_schema.q.out
new file mode 100644
index 0000000..c403527
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/insert_into_with_schema.q.out
@@ -0,0 +1,364 @@
+PREHOOK: query: -- set of tests HIVE-9481
+
+drop database if exists x314 cascade
+PREHOOK: type: DROPDATABASE
+POSTHOOK: query: -- set of tests HIVE-9481
+
+drop database if exists x314 cascade
+POSTHOOK: type: DROPDATABASE
+PREHOOK: query: create database x314
+PREHOOK: type: CREATEDATABASE
+PREHOOK: Output: database:x314
+POSTHOOK: query: create database x314
+POSTHOOK: type: CREATEDATABASE
+POSTHOOK: Output: database:x314
+PREHOOK: query: use x314
+PREHOOK: type: SWITCHDATABASE
+PREHOOK: Input: database:x314
+POSTHOOK: query: use x314
+POSTHOOK: type: SWITCHDATABASE
+POSTHOOK: Input: database:x314
+PREHOOK: query: create table source(s1 int, s2 int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:x314
+PREHOOK: Output: x314@source
+POSTHOOK: query: create table source(s1 int, s2 int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:x314
+POSTHOOK: Output: x314@source
+PREHOOK: query: create table target1(x int, y int, z int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:x314
+PREHOOK: Output: x314@target1
+POSTHOOK: query: create table target1(x int, y int, z int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:x314
+POSTHOOK: Output: x314@target1
+PREHOOK: query: create table target2(x int, y int, z int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:x314
+PREHOOK: Output: x314@target2
+POSTHOOK: query: create table target2(x int, y int, z int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:x314
+POSTHOOK: Output: x314@target2
+PREHOOK: query: create table target3(x int, y int, z int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:x314
+PREHOOK: Output: x314@target3
+POSTHOOK: query: create table target3(x int, y int, z int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:x314
+POSTHOOK: Output: x314@target3
+PREHOOK: query: insert into source(s2,s1) values(2,1)
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@values__tmp__table__1
+PREHOOK: Output: x314@source
+POSTHOOK: query: insert into source(s2,s1) values(2,1)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@values__tmp__table__1
+POSTHOOK: Output: x314@source
+POSTHOOK: Lineage: source.s1 EXPRESSION 
[(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+POSTHOOK: Lineage: source.s2 EXPRESSION 
[(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+PREHOOK: query: -- expect source to contain 1 row (1,2)
+select * from source
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@source
+#### A masked pattern was here ####
+POSTHOOK: query: -- expect source to contain 1 row (1,2)
+select * from source
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@source
+#### A masked pattern was here ####
+1      2
+PREHOOK: query: insert into target1(z,x) select * from source
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@source
+PREHOOK: Output: x314@target1
+POSTHOOK: query: insert into target1(z,x) select * from source
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@source
+POSTHOOK: Output: x314@target1
+POSTHOOK: Lineage: target1.x SIMPLE [(source)source.FieldSchema(name:s2, 
type:int, comment:null), ]
+POSTHOOK: Lineage: target1.y SIMPLE []
+POSTHOOK: Lineage: target1.z SIMPLE [(source)source.FieldSchema(name:s1, 
type:int, comment:null), ]
+PREHOOK: query: -- expect target1 to contain 1 row (2,NULL,1)
+select * from target1
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@target1
+#### A masked pattern was here ####
+POSTHOOK: query: -- expect target1 to contain 1 row (2,NULL,1)
+select * from target1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@target1
+#### A masked pattern was here ####
+2      NULL    1
+PREHOOK: query: -- note that schema spec for target1 and target2 are different
+from source insert into target1(x,y) select * insert into target2(x,z) select 
s2,s1
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@source
+PREHOOK: Output: x314@target1
+PREHOOK: Output: x314@target2
+POSTHOOK: query: -- note that schema spec for target1 and target2 are different
+from source insert into target1(x,y) select * insert into target2(x,z) select 
s2,s1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@source
+POSTHOOK: Output: x314@target1
+POSTHOOK: Output: x314@target2
+POSTHOOK: Lineage: target1.x SIMPLE [(source)source.FieldSchema(name:s1, 
type:int, comment:null), ]
+POSTHOOK: Lineage: target1.y SIMPLE [(source)source.FieldSchema(name:s2, 
type:int, comment:null), ]
+POSTHOOK: Lineage: target1.z SIMPLE []
+POSTHOOK: Lineage: target2.x SIMPLE [(source)source.FieldSchema(name:s2, 
type:int, comment:null), ]
+POSTHOOK: Lineage: target2.y SIMPLE []
+POSTHOOK: Lineage: target2.z SIMPLE [(source)source.FieldSchema(name:s1, 
type:int, comment:null), ]
+PREHOOK: query: --expect target1 to have 2rows (2,NULL,1), (1,2,NULL)
+select * from target1 order by x,y,z
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@target1
+#### A masked pattern was here ####
+POSTHOOK: query: --expect target1 to have 2rows (2,NULL,1), (1,2,NULL)
+select * from target1 order by x,y,z
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@target1
+#### A masked pattern was here ####
+1      2       NULL
+2      NULL    1
+PREHOOK: query: -- expect target2 to have 1 row: (2,NULL,1)
+select * from target2
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@target2
+#### A masked pattern was here ####
+POSTHOOK: query: -- expect target2 to have 1 row: (2,NULL,1)
+select * from target2
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@target2
+#### A masked pattern was here ####
+2      NULL    1
+PREHOOK: query: from source insert into target1(x,y,z) select null as x, * 
insert into target2(x,y,z) select null as x, source.*
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@source
+PREHOOK: Output: x314@target1
+PREHOOK: Output: x314@target2
+POSTHOOK: query: from source insert into target1(x,y,z) select null as x, * 
insert into target2(x,y,z) select null as x, source.*
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@source
+POSTHOOK: Output: x314@target1
+POSTHOOK: Output: x314@target2
+POSTHOOK: Lineage: target1.x EXPRESSION []
+POSTHOOK: Lineage: target1.y SIMPLE [(source)source.FieldSchema(name:s1, 
type:int, comment:null), ]
+POSTHOOK: Lineage: target1.z SIMPLE [(source)source.FieldSchema(name:s2, 
type:int, comment:null), ]
+POSTHOOK: Lineage: target2.x EXPRESSION []
+POSTHOOK: Lineage: target2.y SIMPLE [(source)source.FieldSchema(name:s1, 
type:int, comment:null), ]
+POSTHOOK: Lineage: target2.z SIMPLE [(source)source.FieldSchema(name:s2, 
type:int, comment:null), ]
+PREHOOK: query: -- expect target1 to have 3 rows: (2,NULL,1), (1,2,NULL), 
(NULL, 1,2)
+select * from target1 order by x,y,z
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@target1
+#### A masked pattern was here ####
+POSTHOOK: query: -- expect target1 to have 3 rows: (2,NULL,1), (1,2,NULL), 
(NULL, 1,2)
+select * from target1 order by x,y,z
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@target1
+#### A masked pattern was here ####
+NULL   1       2
+1      2       NULL
+2      NULL    1
+PREHOOK: query: -- expect target2 to have 2 rows: (2,NULL,1), (NULL, 1,2)
+select * from target2 order by x,y,z
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@target2
+#### A masked pattern was here ####
+POSTHOOK: query: -- expect target2 to have 2 rows: (2,NULL,1), (NULL, 1,2)
+select * from target2 order by x,y,z
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@target2
+#### A masked pattern was here ####
+NULL   1       2
+2      NULL    1
+PREHOOK: query: create table source2(s1 int, s2 int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:x314
+PREHOOK: Output: x314@source2
+POSTHOOK: query: create table source2(s1 int, s2 int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:x314
+POSTHOOK: Output: x314@source2
+PREHOOK: query: insert into target3 (x,z) select source.s1,source2.s2 from 
source left outer join source2 on source.s1=source2.s2
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@source
+PREHOOK: Input: x314@source2
+PREHOOK: Output: x314@target3
+POSTHOOK: query: insert into target3 (x,z) select source.s1,source2.s2 from 
source left outer join source2 on source.s1=source2.s2
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@source
+POSTHOOK: Input: x314@source2
+POSTHOOK: Output: x314@target3
+POSTHOOK: Lineage: target3.x SIMPLE [(source)source.FieldSchema(name:s1, 
type:int, comment:null), ]
+POSTHOOK: Lineage: target3.y SIMPLE []
+POSTHOOK: Lineage: target3.z SIMPLE [(source2)source2.FieldSchema(name:s2, 
type:int, comment:null), ]
+PREHOOK: query: --expect target3 to have 1 row (1,NULL,NULL)
+select * from target3
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@target3
+#### A masked pattern was here ####
+POSTHOOK: query: --expect target3 to have 1 row (1,NULL,NULL)
+select * from target3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@target3
+#### A masked pattern was here ####
+1      NULL    NULL
+PREHOOK: query: -- partitioned tables
+CREATE TABLE pageviews (userid VARCHAR(64), link STRING, source STRING) 
PARTITIONED BY (datestamp STRING, i int) CLUSTERED BY (userid) INTO 4 BUCKETS 
STORED AS ORC
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:x314
+PREHOOK: Output: x314@pageviews
+POSTHOOK: query: -- partitioned tables
+CREATE TABLE pageviews (userid VARCHAR(64), link STRING, source STRING) 
PARTITIONED BY (datestamp STRING, i int) CLUSTERED BY (userid) INTO 4 BUCKETS 
STORED AS ORC
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:x314
+POSTHOOK: Output: x314@pageviews
+PREHOOK: query: INSERT INTO TABLE pageviews PARTITION (datestamp = 
'2014-09-23', i = 1)(userid,link) VALUES ('jsmith', 'mail.com')
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@values__tmp__table__2
+PREHOOK: Output: x314@pageviews@datestamp=2014-09-23/i=1
+POSTHOOK: query: INSERT INTO TABLE pageviews PARTITION (datestamp = 
'2014-09-23', i = 1)(userid,link) VALUES ('jsmith', 'mail.com')
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@values__tmp__table__2
+POSTHOOK: Output: x314@pageviews@datestamp=2014-09-23/i=1
+POSTHOOK: Lineage: pageviews PARTITION(datestamp=2014-09-23,i=1).link SIMPLE 
[(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+POSTHOOK: Lineage: pageviews PARTITION(datestamp=2014-09-23,i=1).source SIMPLE 
[]
+POSTHOOK: Lineage: pageviews PARTITION(datestamp=2014-09-23,i=1).userid 
EXPRESSION 
[(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+PREHOOK: query: -- expect 1 row: ('jsmith', 'mail.com', NULL) in partition 
'2014-09-23'/'1'
+select * from pageviews
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@pageviews
+PREHOOK: Input: x314@pageviews@datestamp=2014-09-23/i=1
+#### A masked pattern was here ####
+POSTHOOK: query: -- expect 1 row: ('jsmith', 'mail.com', NULL) in partition 
'2014-09-23'/'1'
+select * from pageviews
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@pageviews
+POSTHOOK: Input: x314@pageviews@datestamp=2014-09-23/i=1
+#### A masked pattern was here ####
+jsmith mail.com        NULL    2014-09-23      1
+PREHOOK: query: -- dynamic partitioning 
+
+
+
+INSERT INTO TABLE pageviews PARTITION 
(datestamp='2014-09-23',i)(userid,i,link) VALUES ('jsmith', 7, '7mail.com')
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@values__tmp__table__3
+PREHOOK: Output: x314@pageviews@datestamp=2014-09-23
+POSTHOOK: query: -- dynamic partitioning 
+
+
+
+INSERT INTO TABLE pageviews PARTITION 
(datestamp='2014-09-23',i)(userid,i,link) VALUES ('jsmith', 7, '7mail.com')
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@values__tmp__table__3
+POSTHOOK: Output: x314@pageviews@datestamp=2014-09-23/i=7
+POSTHOOK: Lineage: pageviews PARTITION(datestamp=2014-09-23,i=7).link SIMPLE 
[(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
+POSTHOOK: Lineage: pageviews PARTITION(datestamp=2014-09-23,i=7).source SIMPLE 
[]
+POSTHOOK: Lineage: pageviews PARTITION(datestamp=2014-09-23,i=7).userid 
EXPRESSION 
[(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+PREHOOK: query: INSERT INTO TABLE pageviews PARTITION 
(datestamp,i)(userid,i,link,datestamp) VALUES ('jsmith', 17, '17mail.com', 
'2014-09-23')
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@values__tmp__table__4
+PREHOOK: Output: x314@pageviews
+POSTHOOK: query: INSERT INTO TABLE pageviews PARTITION 
(datestamp,i)(userid,i,link,datestamp) VALUES ('jsmith', 17, '17mail.com', 
'2014-09-23')
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@values__tmp__table__4
+POSTHOOK: Output: x314@pageviews@datestamp=2014-09-23/i=17
+POSTHOOK: Lineage: pageviews PARTITION(datestamp=2014-09-23,i=17).link SIMPLE 
[(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
+POSTHOOK: Lineage: pageviews PARTITION(datestamp=2014-09-23,i=17).source 
SIMPLE []
+POSTHOOK: Lineage: pageviews PARTITION(datestamp=2014-09-23,i=17).userid 
EXPRESSION 
[(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+PREHOOK: query: INSERT INTO TABLE pageviews PARTITION 
(datestamp,i)(userid,i,link,datestamp) VALUES ('jsmith', 19, '19mail.com', 
'2014-09-24')
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@values__tmp__table__5
+PREHOOK: Output: x314@pageviews
+POSTHOOK: query: INSERT INTO TABLE pageviews PARTITION 
(datestamp,i)(userid,i,link,datestamp) VALUES ('jsmith', 19, '19mail.com', 
'2014-09-24')
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@values__tmp__table__5
+POSTHOOK: Output: x314@pageviews@datestamp=2014-09-24/i=19
+POSTHOOK: Lineage: pageviews PARTITION(datestamp=2014-09-24,i=19).link SIMPLE 
[(values__tmp__table__5)values__tmp__table__5.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
+POSTHOOK: Lineage: pageviews PARTITION(datestamp=2014-09-24,i=19).source 
SIMPLE []
+POSTHOOK: Lineage: pageviews PARTITION(datestamp=2014-09-24,i=19).userid 
EXPRESSION 
[(values__tmp__table__5)values__tmp__table__5.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+PREHOOK: query: -- here the 'datestamp' partition column is not provided and 
will be NULL-filled
+INSERT INTO TABLE pageviews PARTITION (datestamp,i)(userid,i,link) VALUES 
('jsmith', 23, '23mail.com')
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@values__tmp__table__6
+PREHOOK: Output: x314@pageviews
+POSTHOOK: query: -- here the 'datestamp' partition column is not provided and 
will be NULL-filled
+INSERT INTO TABLE pageviews PARTITION (datestamp,i)(userid,i,link) VALUES 
('jsmith', 23, '23mail.com')
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@values__tmp__table__6
+POSTHOOK: Output: x314@pageviews@datestamp=__HIVE_DEFAULT_PARTITION__/i=23
+POSTHOOK: Lineage: pageviews 
PARTITION(datestamp=__HIVE_DEFAULT_PARTITION__,i=23).link SIMPLE 
[(values__tmp__table__6)values__tmp__table__6.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
+POSTHOOK: Lineage: pageviews 
PARTITION(datestamp=__HIVE_DEFAULT_PARTITION__,i=23).source SIMPLE []
+POSTHOOK: Lineage: pageviews 
PARTITION(datestamp=__HIVE_DEFAULT_PARTITION__,i=23).userid EXPRESSION 
[(values__tmp__table__6)values__tmp__table__6.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+PREHOOK: query: -- expect 5 rows:
+-- expect ('jsmith', 'mail.com', NULL) in partition '2014-09-23'/'1'
+-- expect ('jsmith', '7mail.com', NULL) in partition '2014-09-23'/'7'
+-- expect ('jsmith', '17mail.com', NULL) in partition '2014-09-23'/'17'
+-- expect ('jsmith', '19mail.com', NULL) in partition '2014-09-24'/'19'
+-- expect ('jsmith', '23mail.com', NULL) in partition 
'__HIVE_DEFAULT_PARTITION__'/'23'
+select * from pageviews order by link
+PREHOOK: type: QUERY
+PREHOOK: Input: x314@pageviews
+PREHOOK: Input: x314@pageviews@datestamp=2014-09-23/i=1
+PREHOOK: Input: x314@pageviews@datestamp=2014-09-23/i=17
+PREHOOK: Input: x314@pageviews@datestamp=2014-09-23/i=7
+PREHOOK: Input: x314@pageviews@datestamp=2014-09-24/i=19
+PREHOOK: Input: x314@pageviews@datestamp=__HIVE_DEFAULT_PARTITION__/i=23
+#### A masked pattern was here ####
+POSTHOOK: query: -- expect 5 rows:
+-- expect ('jsmith', 'mail.com', NULL) in partition '2014-09-23'/'1'
+-- expect ('jsmith', '7mail.com', NULL) in partition '2014-09-23'/'7'
+-- expect ('jsmith', '17mail.com', NULL) in partition '2014-09-23'/'17'
+-- expect ('jsmith', '19mail.com', NULL) in partition '2014-09-24'/'19'
+-- expect ('jsmith', '23mail.com', NULL) in partition 
'__HIVE_DEFAULT_PARTITION__'/'23'
+select * from pageviews order by link
+POSTHOOK: type: QUERY
+POSTHOOK: Input: x314@pageviews
+POSTHOOK: Input: x314@pageviews@datestamp=2014-09-23/i=1
+POSTHOOK: Input: x314@pageviews@datestamp=2014-09-23/i=17
+POSTHOOK: Input: x314@pageviews@datestamp=2014-09-23/i=7
+POSTHOOK: Input: x314@pageviews@datestamp=2014-09-24/i=19
+POSTHOOK: Input: x314@pageviews@datestamp=__HIVE_DEFAULT_PARTITION__/i=23
+#### A masked pattern was here ####
+jsmith 17mail.com      NULL    2014-09-23      17
+jsmith 19mail.com      NULL    2014-09-24      19
+jsmith 23mail.com      NULL    __HIVE_DEFAULT_PARTITION__      23
+jsmith 7mail.com       NULL    2014-09-23      7
+jsmith mail.com        NULL    2014-09-23      1
+PREHOOK: query: drop database if exists x314 cascade
+PREHOOK: type: DROPDATABASE
+PREHOOK: Input: database:x314
+PREHOOK: Output: database:x314
+PREHOOK: Output: x314@pageviews
+PREHOOK: Output: x314@source
+PREHOOK: Output: x314@source2
+PREHOOK: Output: x314@target1
+PREHOOK: Output: x314@target2
+PREHOOK: Output: x314@target3
+PREHOOK: Output: x314@values__tmp__table__1
+PREHOOK: Output: x314@values__tmp__table__2
+PREHOOK: Output: x314@values__tmp__table__3
+PREHOOK: Output: x314@values__tmp__table__4
+PREHOOK: Output: x314@values__tmp__table__5
+PREHOOK: Output: x314@values__tmp__table__6
+POSTHOOK: query: drop database if exists x314 cascade
+POSTHOOK: type: DROPDATABASE
+POSTHOOK: Input: database:x314
+POSTHOOK: Output: database:x314
+POSTHOOK: Output: x314@pageviews
+POSTHOOK: Output: x314@source
+POSTHOOK: Output: x314@source2
+POSTHOOK: Output: x314@target1
+POSTHOOK: Output: x314@target2
+POSTHOOK: Output: x314@target3
+POSTHOOK: Output: x314@values__tmp__table__1
+POSTHOOK: Output: x314@values__tmp__table__2
+POSTHOOK: Output: x314@values__tmp__table__3
+POSTHOOK: Output: x314@values__tmp__table__4
+POSTHOOK: Output: x314@values__tmp__table__5
+POSTHOOK: Output: x314@values__tmp__table__6

http://git-wip-us.apache.org/repos/asf/hive/blob/1f258e96/ql/src/test/results/clientpositive/llap/join43.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/join43.q.out 
b/ql/src/test/results/clientpositive/llap/join43.q.out
new file mode 100644
index 0000000..888e1ee
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/join43.q.out
@@ -0,0 +1,648 @@
+PREHOOK: query: create table purchase_history (s string, product string, price 
double, time int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@purchase_history
+POSTHOOK: query: create table purchase_history (s string, product string, 
price double, time int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@purchase_history
+PREHOOK: query: insert into purchase_history values ('1', 'Belt', 20.00, 21)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__1
+PREHOOK: Output: default@purchase_history
+POSTHOOK: query: insert into purchase_history values ('1', 'Belt', 20.00, 21)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__1
+POSTHOOK: Output: default@purchase_history
+POSTHOOK: Lineage: purchase_history.price EXPRESSION 
[(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
+POSTHOOK: Lineage: purchase_history.product SIMPLE 
[(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+POSTHOOK: Lineage: purchase_history.s SIMPLE 
[(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: purchase_history.time EXPRESSION 
[(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col4, 
type:string, comment:), ]
+PREHOOK: query: insert into purchase_history values ('1', 'Socks', 3.50, 31)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__2
+PREHOOK: Output: default@purchase_history
+POSTHOOK: query: insert into purchase_history values ('1', 'Socks', 3.50, 31)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__2
+POSTHOOK: Output: default@purchase_history
+POSTHOOK: Lineage: purchase_history.price EXPRESSION 
[(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
+POSTHOOK: Lineage: purchase_history.product SIMPLE 
[(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+POSTHOOK: Lineage: purchase_history.s SIMPLE 
[(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: purchase_history.time EXPRESSION 
[(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col4, 
type:string, comment:), ]
+PREHOOK: query: insert into purchase_history values ('3', 'Belt', 20.00, 51)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__3
+PREHOOK: Output: default@purchase_history
+POSTHOOK: query: insert into purchase_history values ('3', 'Belt', 20.00, 51)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__3
+POSTHOOK: Output: default@purchase_history
+POSTHOOK: Lineage: purchase_history.price EXPRESSION 
[(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
+POSTHOOK: Lineage: purchase_history.product SIMPLE 
[(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+POSTHOOK: Lineage: purchase_history.s SIMPLE 
[(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: purchase_history.time EXPRESSION 
[(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col4, 
type:string, comment:), ]
+PREHOOK: query: insert into purchase_history values ('4', 'Shirt', 15.50, 59)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__4
+PREHOOK: Output: default@purchase_history
+POSTHOOK: query: insert into purchase_history values ('4', 'Shirt', 15.50, 59)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__4
+POSTHOOK: Output: default@purchase_history
+POSTHOOK: Lineage: purchase_history.price EXPRESSION 
[(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
+POSTHOOK: Lineage: purchase_history.product SIMPLE 
[(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+POSTHOOK: Lineage: purchase_history.s SIMPLE 
[(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: purchase_history.time EXPRESSION 
[(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col4, 
type:string, comment:), ]
+PREHOOK: query: create table cart_history (s string, cart_id int, time int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@cart_history
+POSTHOOK: query: create table cart_history (s string, cart_id int, time int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@cart_history
+PREHOOK: query: insert into cart_history values ('1', 1, 10)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__5
+PREHOOK: Output: default@cart_history
+POSTHOOK: query: insert into cart_history values ('1', 1, 10)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__5
+POSTHOOK: Output: default@cart_history
+POSTHOOK: Lineage: cart_history.cart_id EXPRESSION 
[(values__tmp__table__5)values__tmp__table__5.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+POSTHOOK: Lineage: cart_history.s SIMPLE 
[(values__tmp__table__5)values__tmp__table__5.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: cart_history.time EXPRESSION 
[(values__tmp__table__5)values__tmp__table__5.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
+PREHOOK: query: insert into cart_history values ('1', 2, 20)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__6
+PREHOOK: Output: default@cart_history
+POSTHOOK: query: insert into cart_history values ('1', 2, 20)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__6
+POSTHOOK: Output: default@cart_history
+POSTHOOK: Lineage: cart_history.cart_id EXPRESSION 
[(values__tmp__table__6)values__tmp__table__6.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+POSTHOOK: Lineage: cart_history.s SIMPLE 
[(values__tmp__table__6)values__tmp__table__6.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: cart_history.time EXPRESSION 
[(values__tmp__table__6)values__tmp__table__6.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
+PREHOOK: query: insert into cart_history values ('1', 3, 30)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__7
+PREHOOK: Output: default@cart_history
+POSTHOOK: query: insert into cart_history values ('1', 3, 30)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__7
+POSTHOOK: Output: default@cart_history
+POSTHOOK: Lineage: cart_history.cart_id EXPRESSION 
[(values__tmp__table__7)values__tmp__table__7.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+POSTHOOK: Lineage: cart_history.s SIMPLE 
[(values__tmp__table__7)values__tmp__table__7.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: cart_history.time EXPRESSION 
[(values__tmp__table__7)values__tmp__table__7.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
+PREHOOK: query: insert into cart_history values ('1', 4, 40)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__8
+PREHOOK: Output: default@cart_history
+POSTHOOK: query: insert into cart_history values ('1', 4, 40)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__8
+POSTHOOK: Output: default@cart_history
+POSTHOOK: Lineage: cart_history.cart_id EXPRESSION 
[(values__tmp__table__8)values__tmp__table__8.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+POSTHOOK: Lineage: cart_history.s SIMPLE 
[(values__tmp__table__8)values__tmp__table__8.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: cart_history.time EXPRESSION 
[(values__tmp__table__8)values__tmp__table__8.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
+PREHOOK: query: insert into cart_history values ('3', 5, 50)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__9
+PREHOOK: Output: default@cart_history
+POSTHOOK: query: insert into cart_history values ('3', 5, 50)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__9
+POSTHOOK: Output: default@cart_history
+POSTHOOK: Lineage: cart_history.cart_id EXPRESSION 
[(values__tmp__table__9)values__tmp__table__9.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+POSTHOOK: Lineage: cart_history.s SIMPLE 
[(values__tmp__table__9)values__tmp__table__9.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: cart_history.time EXPRESSION 
[(values__tmp__table__9)values__tmp__table__9.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
+PREHOOK: query: insert into cart_history values ('4', 6, 60)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__10
+PREHOOK: Output: default@cart_history
+POSTHOOK: query: insert into cart_history values ('4', 6, 60)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__10
+POSTHOOK: Output: default@cart_history
+POSTHOOK: Lineage: cart_history.cart_id EXPRESSION 
[(values__tmp__table__10)values__tmp__table__10.FieldSchema(name:tmp_values_col2,
 type:string, comment:), ]
+POSTHOOK: Lineage: cart_history.s SIMPLE 
[(values__tmp__table__10)values__tmp__table__10.FieldSchema(name:tmp_values_col1,
 type:string, comment:), ]
+POSTHOOK: Lineage: cart_history.time EXPRESSION 
[(values__tmp__table__10)values__tmp__table__10.FieldSchema(name:tmp_values_col3,
 type:string, comment:), ]
+PREHOOK: query: create table events (s string, st2 string, n int, time int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@events
+POSTHOOK: query: create table events (s string, st2 string, n int, time int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@events
+PREHOOK: query: insert into events values ('1', 'Bob', 1234, 20)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__11
+PREHOOK: Output: default@events
+POSTHOOK: query: insert into events values ('1', 'Bob', 1234, 20)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__11
+POSTHOOK: Output: default@events
+POSTHOOK: Lineage: events.n EXPRESSION 
[(values__tmp__table__11)values__tmp__table__11.FieldSchema(name:tmp_values_col3,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.s SIMPLE 
[(values__tmp__table__11)values__tmp__table__11.FieldSchema(name:tmp_values_col1,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.st2 SIMPLE 
[(values__tmp__table__11)values__tmp__table__11.FieldSchema(name:tmp_values_col2,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.time EXPRESSION 
[(values__tmp__table__11)values__tmp__table__11.FieldSchema(name:tmp_values_col4,
 type:string, comment:), ]
+PREHOOK: query: insert into events values ('1', 'Bob', 1234, 30)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__12
+PREHOOK: Output: default@events
+POSTHOOK: query: insert into events values ('1', 'Bob', 1234, 30)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__12
+POSTHOOK: Output: default@events
+POSTHOOK: Lineage: events.n EXPRESSION 
[(values__tmp__table__12)values__tmp__table__12.FieldSchema(name:tmp_values_col3,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.s SIMPLE 
[(values__tmp__table__12)values__tmp__table__12.FieldSchema(name:tmp_values_col1,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.st2 SIMPLE 
[(values__tmp__table__12)values__tmp__table__12.FieldSchema(name:tmp_values_col2,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.time EXPRESSION 
[(values__tmp__table__12)values__tmp__table__12.FieldSchema(name:tmp_values_col4,
 type:string, comment:), ]
+PREHOOK: query: insert into events values ('1', 'Bob', 1234, 25)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__13
+PREHOOK: Output: default@events
+POSTHOOK: query: insert into events values ('1', 'Bob', 1234, 25)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__13
+POSTHOOK: Output: default@events
+POSTHOOK: Lineage: events.n EXPRESSION 
[(values__tmp__table__13)values__tmp__table__13.FieldSchema(name:tmp_values_col3,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.s SIMPLE 
[(values__tmp__table__13)values__tmp__table__13.FieldSchema(name:tmp_values_col1,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.st2 SIMPLE 
[(values__tmp__table__13)values__tmp__table__13.FieldSchema(name:tmp_values_col2,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.time EXPRESSION 
[(values__tmp__table__13)values__tmp__table__13.FieldSchema(name:tmp_values_col4,
 type:string, comment:), ]
+PREHOOK: query: insert into events values ('2', 'Sam', 1234, 30)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__14
+PREHOOK: Output: default@events
+POSTHOOK: query: insert into events values ('2', 'Sam', 1234, 30)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__14
+POSTHOOK: Output: default@events
+POSTHOOK: Lineage: events.n EXPRESSION 
[(values__tmp__table__14)values__tmp__table__14.FieldSchema(name:tmp_values_col3,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.s SIMPLE 
[(values__tmp__table__14)values__tmp__table__14.FieldSchema(name:tmp_values_col1,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.st2 SIMPLE 
[(values__tmp__table__14)values__tmp__table__14.FieldSchema(name:tmp_values_col2,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.time EXPRESSION 
[(values__tmp__table__14)values__tmp__table__14.FieldSchema(name:tmp_values_col4,
 type:string, comment:), ]
+PREHOOK: query: insert into events values ('3', 'Jeff', 1234, 50)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__15
+PREHOOK: Output: default@events
+POSTHOOK: query: insert into events values ('3', 'Jeff', 1234, 50)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__15
+POSTHOOK: Output: default@events
+POSTHOOK: Lineage: events.n EXPRESSION 
[(values__tmp__table__15)values__tmp__table__15.FieldSchema(name:tmp_values_col3,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.s SIMPLE 
[(values__tmp__table__15)values__tmp__table__15.FieldSchema(name:tmp_values_col1,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.st2 SIMPLE 
[(values__tmp__table__15)values__tmp__table__15.FieldSchema(name:tmp_values_col2,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.time EXPRESSION 
[(values__tmp__table__15)values__tmp__table__15.FieldSchema(name:tmp_values_col4,
 type:string, comment:), ]
+PREHOOK: query: insert into events values ('4', 'Ted', 1234, 60)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__16
+PREHOOK: Output: default@events
+POSTHOOK: query: insert into events values ('4', 'Ted', 1234, 60)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__16
+POSTHOOK: Output: default@events
+POSTHOOK: Lineage: events.n EXPRESSION 
[(values__tmp__table__16)values__tmp__table__16.FieldSchema(name:tmp_values_col3,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.s SIMPLE 
[(values__tmp__table__16)values__tmp__table__16.FieldSchema(name:tmp_values_col1,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.st2 SIMPLE 
[(values__tmp__table__16)values__tmp__table__16.FieldSchema(name:tmp_values_col2,
 type:string, comment:), ]
+POSTHOOK: Lineage: events.time EXPRESSION 
[(values__tmp__table__16)values__tmp__table__16.FieldSchema(name:tmp_values_col4,
 type:string, comment:), ]
+PREHOOK: query: explain
+select s
+from (
+  select last.*, action.st2, action.n
+  from (
+    select purchase.s, purchase.time, max (mevt.time) as last_stage_time
+    from (select * from purchase_history) purchase
+    join (select * from cart_history) mevt
+    on purchase.s = mevt.s
+    where purchase.time > mevt.time
+    group by purchase.s, purchase.time
+  ) last
+  join (select * from events) action
+  on last.s = action.s and last.last_stage_time = action.time
+) list
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select s
+from (
+  select last.*, action.st2, action.n
+  from (
+    select purchase.s, purchase.time, max (mevt.time) as last_stage_time
+    from (select * from purchase_history) purchase
+    join (select * from cart_history) mevt
+    on purchase.s = mevt.s
+    where purchase.time > mevt.time
+    group by purchase.s, purchase.time
+  ) last
+  join (select * from events) action
+  on last.s = action.s and last.last_stage_time = action.time
+) list
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+#### A masked pattern was here ####
+      Edges:
+        Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 5 (SIMPLE_EDGE)
+        Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
+        Reducer 4 <- Map 6 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: purchase_history
+                  Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE 
Column stats: NONE
+                  Filter Operator
+                    predicate: s is not null (type: boolean)
+                    Statistics: Num rows: 4 Data size: 57 Basic stats: 
COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: s (type: string), time (type: int)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 4 Data size: 57 Basic stats: 
COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 4 Data size: 57 Basic stats: 
COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: cart_history
+                  Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE 
Column stats: NONE
+                  Filter Operator
+                    predicate: s is not null (type: boolean)
+                    Statistics: Num rows: 6 Data size: 36 Basic stats: 
COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: s (type: string), time (type: int)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 6 Data size: 36 Basic stats: 
COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 6 Data size: 36 Basic stats: 
COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 6 
+            Map Operator Tree:
+                TableScan
+                  alias: events
+                  Statistics: Num rows: 6 Data size: 79 Basic stats: COMPLETE 
Column stats: NONE
+                  Filter Operator
+                    predicate: (s is not null and time is not null) (type: 
boolean)
+                    Statistics: Num rows: 6 Data size: 79 Basic stats: 
COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: s (type: string), time (type: int)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 6 Data size: 79 Basic stats: 
COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string), _col1 (type: 
int)
+                        sort order: ++
+                        Map-reduce partition columns: _col0 (type: string), 
_col1 (type: int)
+                        Statistics: Num rows: 6 Data size: 79 Basic stats: 
COMPLETE Column stats: NONE
+            Execution mode: llap
+            LLAP IO: no inputs
+        Reducer 2 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Merge Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col0 (type: string)
+                  1 _col0 (type: string)
+                outputColumnNames: _col0, _col1, _col3
+                Statistics: Num rows: 6 Data size: 39 Basic stats: COMPLETE 
Column stats: NONE
+                Filter Operator
+                  predicate: (_col1 > _col3) (type: boolean)
+                  Statistics: Num rows: 2 Data size: 13 Basic stats: COMPLETE 
Column stats: NONE
+                  Group By Operator
+                    aggregations: max(_col3)
+                    keys: _col0 (type: string), _col1 (type: int)
+                    mode: hash
+                    outputColumnNames: _col0, _col1, _col2
+                    Statistics: Num rows: 2 Data size: 13 Basic stats: 
COMPLETE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string), _col1 (type: int)
+                      sort order: ++
+                      Map-reduce partition columns: _col0 (type: string), 
_col1 (type: int)
+                      Statistics: Num rows: 2 Data size: 13 Basic stats: 
COMPLETE Column stats: NONE
+                      value expressions: _col2 (type: int)
+        Reducer 3 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: max(VALUE._col0)
+                keys: KEY._col0 (type: string), KEY._col1 (type: int)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1 Data size: 6 Basic stats: COMPLETE 
Column stats: NONE
+                Select Operator
+                  expressions: _col0 (type: string), _col2 (type: int)
+                  outputColumnNames: _col0, _col2
+                  Statistics: Num rows: 1 Data size: 6 Basic stats: COMPLETE 
Column stats: NONE
+                  Filter Operator
+                    predicate: _col2 is not null (type: boolean)
+                    Statistics: Num rows: 1 Data size: 6 Basic stats: COMPLETE 
Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string), _col2 (type: int)
+                      sort order: ++
+                      Map-reduce partition columns: _col0 (type: string), 
_col2 (type: int)
+                      Statistics: Num rows: 1 Data size: 6 Basic stats: 
COMPLETE Column stats: NONE
+        Reducer 4 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Merge Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col0 (type: string), _col2 (type: int)
+                  1 _col0 (type: string), _col1 (type: int)
+                outputColumnNames: _col0
+                Statistics: Num rows: 6 Data size: 86 Basic stats: COMPLETE 
Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 6 Data size: 86 Basic stats: COMPLETE 
Column stats: NONE
+                  table:
+                      input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                      output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select s
+from (
+  select last.*, action.st2, action.n
+  from (
+    select purchase.s, purchase.time, max (mevt.time) as last_stage_time
+    from (select * from purchase_history) purchase
+    join (select * from cart_history) mevt
+    on purchase.s = mevt.s
+    where purchase.time > mevt.time
+    group by purchase.s, purchase.time
+  ) last
+  join (select * from events) action
+  on last.s = action.s and last.last_stage_time = action.time
+) list
+PREHOOK: type: QUERY
+PREHOOK: Input: default@cart_history
+PREHOOK: Input: default@events
+PREHOOK: Input: default@purchase_history
+#### A masked pattern was here ####
+POSTHOOK: query: select s
+from (
+  select last.*, action.st2, action.n
+  from (
+    select purchase.s, purchase.time, max (mevt.time) as last_stage_time
+    from (select * from purchase_history) purchase
+    join (select * from cart_history) mevt
+    on purchase.s = mevt.s
+    where purchase.time > mevt.time
+    group by purchase.s, purchase.time
+  ) last
+  join (select * from events) action
+  on last.s = action.s and last.last_stage_time = action.time
+) list
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@cart_history
+POSTHOOK: Input: default@events
+POSTHOOK: Input: default@purchase_history
+#### A masked pattern was here ####
+1
+1
+3
+PREHOOK: query: explain
+select *
+from (
+  select last.*, action.st2, action.n
+  from (
+    select purchase.s, purchase.time, max (mevt.time) as last_stage_time
+    from (select * from purchase_history) purchase
+    join (select * from cart_history) mevt
+    on purchase.s = mevt.s
+    where purchase.time > mevt.time
+    group by purchase.s, purchase.time
+  ) last
+  join (select * from events) action
+  on last.s = action.s and last.last_stage_time = action.time
+) list
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select *
+from (
+  select last.*, action.st2, action.n
+  from (
+    select purchase.s, purchase.time, max (mevt.time) as last_stage_time
+    from (select * from purchase_history) purchase
+    join (select * from cart_history) mevt
+    on purchase.s = mevt.s
+    where purchase.time > mevt.time
+    group by purchase.s, purchase.time
+  ) last
+  join (select * from events) action
+  on last.s = action.s and last.last_stage_time = action.time
+) list
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Tez
+#### A masked pattern was here ####
+      Edges:
+        Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 5 (SIMPLE_EDGE)
+        Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
+        Reducer 4 <- Map 6 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: purchase_history
+                  Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE 
Column stats: NONE
+                  Filter Operator
+                    predicate: s is not null (type: boolean)
+                    Statistics: Num rows: 4 Data size: 57 Basic stats: 
COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: s (type: string), time (type: int)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 4 Data size: 57 Basic stats: 
COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 4 Data size: 57 Basic stats: 
COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: cart_history
+                  Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE 
Column stats: NONE
+                  Filter Operator
+                    predicate: s is not null (type: boolean)
+                    Statistics: Num rows: 6 Data size: 36 Basic stats: 
COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: s (type: string), time (type: int)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 6 Data size: 36 Basic stats: 
COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 6 Data size: 36 Basic stats: 
COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 6 
+            Map Operator Tree:
+                TableScan
+                  alias: events
+                  Statistics: Num rows: 6 Data size: 79 Basic stats: COMPLETE 
Column stats: NONE
+                  Filter Operator
+                    predicate: (s is not null and time is not null) (type: 
boolean)
+                    Statistics: Num rows: 6 Data size: 79 Basic stats: 
COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: s (type: string), st2 (type: string), n 
(type: int), time (type: int)
+                      outputColumnNames: _col0, _col1, _col2, _col3
+                      Statistics: Num rows: 6 Data size: 79 Basic stats: 
COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string), _col3 (type: 
int)
+                        sort order: ++
+                        Map-reduce partition columns: _col0 (type: string), 
_col3 (type: int)
+                        Statistics: Num rows: 6 Data size: 79 Basic stats: 
COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: string), _col2 (type: 
int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Reducer 2 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Merge Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col0 (type: string)
+                  1 _col0 (type: string)
+                outputColumnNames: _col0, _col1, _col3
+                Statistics: Num rows: 6 Data size: 39 Basic stats: COMPLETE 
Column stats: NONE
+                Filter Operator
+                  predicate: (_col1 > _col3) (type: boolean)
+                  Statistics: Num rows: 2 Data size: 13 Basic stats: COMPLETE 
Column stats: NONE
+                  Group By Operator
+                    aggregations: max(_col3)
+                    keys: _col0 (type: string), _col1 (type: int)
+                    mode: hash
+                    outputColumnNames: _col0, _col1, _col2
+                    Statistics: Num rows: 2 Data size: 13 Basic stats: 
COMPLETE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string), _col1 (type: int)
+                      sort order: ++
+                      Map-reduce partition columns: _col0 (type: string), 
_col1 (type: int)
+                      Statistics: Num rows: 2 Data size: 13 Basic stats: 
COMPLETE Column stats: NONE
+                      value expressions: _col2 (type: int)
+        Reducer 3 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: max(VALUE._col0)
+                keys: KEY._col0 (type: string), KEY._col1 (type: int)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1 Data size: 6 Basic stats: COMPLETE 
Column stats: NONE
+                Filter Operator
+                  predicate: _col2 is not null (type: boolean)
+                  Statistics: Num rows: 1 Data size: 6 Basic stats: COMPLETE 
Column stats: NONE
+                  Reduce Output Operator
+                    key expressions: _col0 (type: string), _col2 (type: int)
+                    sort order: ++
+                    Map-reduce partition columns: _col0 (type: string), _col2 
(type: int)
+                    Statistics: Num rows: 1 Data size: 6 Basic stats: COMPLETE 
Column stats: NONE
+                    value expressions: _col1 (type: int)
+        Reducer 4 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Merge Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col0 (type: string), _col2 (type: int)
+                  1 _col0 (type: string), _col3 (type: int)
+                outputColumnNames: _col0, _col1, _col2, _col4, _col5
+                Statistics: Num rows: 6 Data size: 86 Basic stats: COMPLETE 
Column stats: NONE
+                Select Operator
+                  expressions: _col0 (type: string), _col1 (type: int), _col2 
(type: int), _col4 (type: string), _col5 (type: int)
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                  Statistics: Num rows: 6 Data size: 86 Basic stats: COMPLETE 
Column stats: NONE
+                  File Output Operator
+                    compressed: false
+                    Statistics: Num rows: 6 Data size: 86 Basic stats: 
COMPLETE Column stats: NONE
+                    table:
+                        input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                        output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                        serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select *
+from (
+  select last.*, action.st2, action.n
+  from (
+    select purchase.s, purchase.time, max (mevt.time) as last_stage_time
+    from (select * from purchase_history) purchase
+    join (select * from cart_history) mevt
+    on purchase.s = mevt.s
+    where purchase.time > mevt.time
+    group by purchase.s, purchase.time
+  ) last
+  join (select * from events) action
+  on last.s = action.s and last.last_stage_time = action.time
+) list
+PREHOOK: type: QUERY
+PREHOOK: Input: default@cart_history
+PREHOOK: Input: default@events
+PREHOOK: Input: default@purchase_history
+#### A masked pattern was here ####
+POSTHOOK: query: select *
+from (
+  select last.*, action.st2, action.n
+  from (
+    select purchase.s, purchase.time, max (mevt.time) as last_stage_time
+    from (select * from purchase_history) purchase
+    join (select * from cart_history) mevt
+    on purchase.s = mevt.s
+    where purchase.time > mevt.time
+    group by purchase.s, purchase.time
+  ) last
+  join (select * from events) action
+  on last.s = action.s and last.last_stage_time = action.time
+) list
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@cart_history
+POSTHOOK: Input: default@events
+POSTHOOK: Input: default@purchase_history
+#### A masked pattern was here ####
+1      21      20      Bob     1234
+1      31      30      Bob     1234
+3      51      50      Jeff    1234

Reply via email to