hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcama...@apache.org
Subject [1/4] hive git commit: HIVE-17040: Join elimination in the presence of FK relationship (Jesus Camacho Rodriguez, reviewed by Vineet Garg)
Date Mon, 17 Sep 2018 15:16:41 GMT
Repository: hive
Updated Branches:
  refs/heads/master 7ee7a549a -> befee74df


http://git-wip-us.apache.org/repos/asf/hive/blob/befee74d/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_no_join_opt_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_no_join_opt_2.q.out b/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_no_join_opt_2.q.out
new file mode 100644
index 0000000..283e55d
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_no_join_opt_2.q.out
@@ -0,0 +1,1154 @@
+PREHOOK: query: create table emps_n30 (
+  empid int,
+  deptno int,
+  name varchar(256),
+  salary float,
+  commission int)
+stored as orc TBLPROPERTIES ('transactional'='true')
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@emps_n30
+POSTHOOK: query: create table emps_n30 (
+  empid int,
+  deptno int,
+  name varchar(256),
+  salary float,
+  commission int)
+stored as orc TBLPROPERTIES ('transactional'='true')
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@emps_n30
+PREHOOK: query: insert into emps_n30 values (100, 10, 'Bill', 10000, 1000), (200, 20, 'Eric', 8000, 500),
+  (150, 10, 'Sebastian', 7000, null), (110, 10, 'Theodore', 10000, 250), (120, 10, 'Bill', 10000, 250)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@emps_n30
+POSTHOOK: query: insert into emps_n30 values (100, 10, 'Bill', 10000, 1000), (200, 20, 'Eric', 8000, 500),
+  (150, 10, 'Sebastian', 7000, null), (110, 10, 'Theodore', 10000, 250), (120, 10, 'Bill', 10000, 250)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@emps_n30
+POSTHOOK: Lineage: emps_n30.commission SCRIPT []
+POSTHOOK: Lineage: emps_n30.deptno SCRIPT []
+POSTHOOK: Lineage: emps_n30.empid SCRIPT []
+POSTHOOK: Lineage: emps_n30.name SCRIPT []
+POSTHOOK: Lineage: emps_n30.salary SCRIPT []
+PREHOOK: query: analyze table emps_n30 compute statistics for columns
+PREHOOK: type: ANALYZE_TABLE
+PREHOOK: Input: default@emps_n30
+PREHOOK: Output: default@emps_n30
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table emps_n30 compute statistics for columns
+POSTHOOK: type: ANALYZE_TABLE
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Output: default@emps_n30
+#### A masked pattern was here ####
+PREHOOK: query: create table depts_n20 (
+  deptno int,
+  name varchar(256),
+  locationid int)
+stored as orc TBLPROPERTIES ('transactional'='true')
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@depts_n20
+POSTHOOK: query: create table depts_n20 (
+  deptno int,
+  name varchar(256),
+  locationid int)
+stored as orc TBLPROPERTIES ('transactional'='true')
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@depts_n20
+PREHOOK: query: insert into depts_n20 values (10, 'Sales', 10), (30, 'Marketing', null), (20, 'HR', 20)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@depts_n20
+POSTHOOK: query: insert into depts_n20 values (10, 'Sales', 10), (30, 'Marketing', null), (20, 'HR', 20)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@depts_n20
+POSTHOOK: Lineage: depts_n20.deptno SCRIPT []
+POSTHOOK: Lineage: depts_n20.locationid SCRIPT []
+POSTHOOK: Lineage: depts_n20.name SCRIPT []
+PREHOOK: query: analyze table depts_n20 compute statistics for columns
+PREHOOK: type: ANALYZE_TABLE
+PREHOOK: Input: default@depts_n20
+PREHOOK: Output: default@depts_n20
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table depts_n20 compute statistics for columns
+POSTHOOK: type: ANALYZE_TABLE
+POSTHOOK: Input: default@depts_n20
+POSTHOOK: Output: default@depts_n20
+#### A masked pattern was here ####
+PREHOOK: query: create table dependents_n20 (
+  empid int,
+  name varchar(256))
+stored as orc TBLPROPERTIES ('transactional'='true')
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@dependents_n20
+POSTHOOK: query: create table dependents_n20 (
+  empid int,
+  name varchar(256))
+stored as orc TBLPROPERTIES ('transactional'='true')
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@dependents_n20
+PREHOOK: query: insert into dependents_n20 values (10, 'Michael'), (20, 'Jane')
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@dependents_n20
+POSTHOOK: query: insert into dependents_n20 values (10, 'Michael'), (20, 'Jane')
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@dependents_n20
+POSTHOOK: Lineage: dependents_n20.empid SCRIPT []
+POSTHOOK: Lineage: dependents_n20.name SCRIPT []
+PREHOOK: query: analyze table dependents_n20 compute statistics for columns
+PREHOOK: type: ANALYZE_TABLE
+PREHOOK: Input: default@dependents_n20
+PREHOOK: Output: default@dependents_n20
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table dependents_n20 compute statistics for columns
+POSTHOOK: type: ANALYZE_TABLE
+POSTHOOK: Input: default@dependents_n20
+POSTHOOK: Output: default@dependents_n20
+#### A masked pattern was here ####
+PREHOOK: query: create table locations_n20 (
+  locationid int,
+  name varchar(256))
+stored as orc TBLPROPERTIES ('transactional'='true')
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@locations_n20
+POSTHOOK: query: create table locations_n20 (
+  locationid int,
+  name varchar(256))
+stored as orc TBLPROPERTIES ('transactional'='true')
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@locations_n20
+PREHOOK: query: insert into locations_n20 values (10, 'San Francisco'), (20, 'San Diego')
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@locations_n20
+POSTHOOK: query: insert into locations_n20 values (10, 'San Francisco'), (20, 'San Diego')
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@locations_n20
+POSTHOOK: Lineage: locations_n20.locationid SCRIPT []
+POSTHOOK: Lineage: locations_n20.name SCRIPT []
+PREHOOK: query: analyze table locations_n20 compute statistics for columns
+PREHOOK: type: ANALYZE_TABLE
+PREHOOK: Input: default@locations_n20
+PREHOOK: Output: default@locations_n20
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table locations_n20 compute statistics for columns
+POSTHOOK: type: ANALYZE_TABLE
+POSTHOOK: Input: default@locations_n20
+POSTHOOK: Output: default@locations_n20
+#### A masked pattern was here ####
+PREHOOK: query: alter table emps_n30 add constraint pk1 primary key (empid) disable novalidate rely
+PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
+POSTHOOK: query: alter table emps_n30 add constraint pk1 primary key (empid) disable novalidate rely
+POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
+PREHOOK: query: alter table depts_n20 add constraint pk2 primary key (deptno) disable novalidate rely
+PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
+POSTHOOK: query: alter table depts_n20 add constraint pk2 primary key (deptno) disable novalidate rely
+POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
+PREHOOK: query: alter table dependents_n20 add constraint pk3 primary key (empid) disable novalidate rely
+PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
+POSTHOOK: query: alter table dependents_n20 add constraint pk3 primary key (empid) disable novalidate rely
+POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
+PREHOOK: query: alter table locations_n20 add constraint pk4 primary key (locationid) disable novalidate rely
+PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
+POSTHOOK: query: alter table locations_n20 add constraint pk4 primary key (locationid) disable novalidate rely
+POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
+PREHOOK: query: alter table emps_n30 add constraint fk1 foreign key (deptno) references depts_n20(deptno) disable novalidate rely
+PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
+POSTHOOK: query: alter table emps_n30 add constraint fk1 foreign key (deptno) references depts_n20(deptno) disable novalidate rely
+POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
+PREHOOK: query: alter table depts_n20 add constraint fk2 foreign key (locationid) references locations_n20(locationid) disable novalidate rely
+PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
+POSTHOOK: query: alter table depts_n20 add constraint fk2 foreign key (locationid) references locations_n20(locationid) disable novalidate rely
+POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
+PREHOOK: query: create materialized view mv1_part_n2 partitioned on (deptno) as
+select * from emps_n30 where empid < 150
+PREHOOK: type: CREATE_MATERIALIZED_VIEW
+PREHOOK: Input: default@emps_n30
+PREHOOK: Output: database:default
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: create materialized view mv1_part_n2 partitioned on (deptno) as
+select * from emps_n30 where empid < 150
+POSTHOOK: type: CREATE_MATERIALIZED_VIEW
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@deptno=10
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=10).commission SIMPLE [(emps_n30)emps_n30.FieldSchema(name:commission, type:int, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=10).empid SIMPLE [(emps_n30)emps_n30.FieldSchema(name:empid, type:int, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=10).name SIMPLE [(emps_n30)emps_n30.FieldSchema(name:name, type:varchar(256), comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=10).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+PREHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+PREHOOK: type: ANALYZE_TABLE
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@deptno=10
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2@deptno=10
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+POSTHOOK: type: ANALYZE_TABLE
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@deptno=10
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@deptno=10
+#### A masked pattern was here ####
+PREHOOK: query: explain
+select *
+from (select * from emps_n30 where empid < 120) t
+join depts_n20 using (deptno)
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select *
+from (select * from emps_n30 where empid < 120) t
+join depts_n20 using (deptno)
+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 3 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: default.mv1_part_n2
+                  filterExpr: (empid < 120) (type: boolean)
+                  Statistics: Num rows: 3 Data size: 315 Basic stats: COMPLETE Column stats: COMPLETE
+                  Filter Operator
+                    predicate: (empid < 120) (type: boolean)
+                    Statistics: Num rows: 1 Data size: 105 Basic stats: COMPLETE Column stats: COMPLETE
+                    Select Operator
+                      expressions: empid (type: int), name (type: varchar(256)), salary (type: float), commission (type: int), deptno (type: int)
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                      Statistics: Num rows: 1 Data size: 105 Basic stats: COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        key expressions: _col4 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col4 (type: int)
+                        Statistics: Num rows: 1 Data size: 105 Basic stats: COMPLETE Column stats: COMPLETE
+                        value expressions: _col0 (type: int), _col1 (type: varchar(256)), _col2 (type: float), _col3 (type: int)
+            Execution mode: vectorized, llap
+            LLAP IO: all inputs
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: depts_n20
+                  Statistics: Num rows: 3 Data size: 291 Basic stats: COMPLETE Column stats: COMPLETE
+                  Select Operator
+                    expressions: deptno (type: int), name (type: varchar(256)), locationid (type: int)
+                    outputColumnNames: _col0, _col1, _col2
+                    Statistics: Num rows: 3 Data size: 291 Basic stats: COMPLETE Column stats: COMPLETE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: int)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: int)
+                      Statistics: Num rows: 3 Data size: 291 Basic stats: COMPLETE Column stats: COMPLETE
+                      value expressions: _col1 (type: varchar(256)), _col2 (type: int)
+                    Select Operator
+                      expressions: _col0 (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 3 Data size: 291 Basic stats: COMPLETE Column stats: COMPLETE
+                      Group By Operator
+                        keys: _col0 (type: int)
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 97 Basic stats: COMPLETE Column stats: COMPLETE
+                        Dynamic Partitioning Event Operator
+                          Target column: deptno (int)
+                          Target Input: default.mv1_part_n2
+                          Partition key expr: deptno
+                          Statistics: Num rows: 1 Data size: 97 Basic stats: COMPLETE Column stats: COMPLETE
+                          Target Vertex: Map 1
+            Execution mode: vectorized, llap
+            LLAP IO: may be used (ACID table)
+        Reducer 2 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Merge Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col4 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col0, _col1, _col2, _col3, _col5, _col6, _col7
+                Statistics: Num rows: 1 Data size: 198 Basic stats: COMPLETE Column stats: COMPLETE
+                Select Operator
+                  expressions: _col5 (type: int), _col0 (type: int), _col1 (type: varchar(256)), _col2 (type: float), _col3 (type: int), _col6 (type: varchar(256)), _col7 (type: int)
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6
+                  Statistics: Num rows: 1 Data size: 198 Basic stats: COMPLETE Column stats: COMPLETE
+                  File Output Operator
+                    compressed: false
+                    Statistics: Num rows: 1 Data size: 198 Basic stats: COMPLETE Column stats: COMPLETE
+                    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 * from emps_n30 where empid < 120) t
+join depts_n20 using (deptno)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@depts_n20
+PREHOOK: Input: default@emps_n30
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@deptno=10
+#### A masked pattern was here ####
+POSTHOOK: query: select *
+from (select * from emps_n30 where empid < 120) t
+join depts_n20 using (deptno)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@depts_n20
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@deptno=10
+#### A masked pattern was here ####
+10	100	Bill	10000.0	1000	Sales	10
+10	110	Theodore	10000.0	250	Sales	10
+PREHOOK: query: drop materialized view mv1_part_n2
+PREHOOK: type: DROP_MATERIALIZED_VIEW
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: drop materialized view mv1_part_n2
+POSTHOOK: type: DROP_MATERIALIZED_VIEW
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2
+PREHOOK: query: create materialized view mv1_part_n2 partitioned on (deptno) as
+select deptno, name, salary, commission
+from emps_n30
+PREHOOK: type: CREATE_MATERIALIZED_VIEW
+PREHOOK: Input: default@emps_n30
+PREHOOK: Output: database:default
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: create materialized view mv1_part_n2 partitioned on (deptno) as
+select deptno, name, salary, commission
+from emps_n30
+POSTHOOK: type: CREATE_MATERIALIZED_VIEW
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@deptno=10
+POSTHOOK: Output: default@mv1_part_n2@deptno=20
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=10).commission SIMPLE [(emps_n30)emps_n30.FieldSchema(name:commission, type:int, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=10).name SIMPLE [(emps_n30)emps_n30.FieldSchema(name:name, type:varchar(256), comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=10).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=20).commission SIMPLE [(emps_n30)emps_n30.FieldSchema(name:commission, type:int, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=20).name SIMPLE [(emps_n30)emps_n30.FieldSchema(name:name, type:varchar(256), comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=20).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+PREHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+PREHOOK: type: ANALYZE_TABLE
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@deptno=10
+PREHOOK: Input: default@mv1_part_n2@deptno=20
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2@deptno=10
+PREHOOK: Output: default@mv1_part_n2@deptno=20
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+POSTHOOK: type: ANALYZE_TABLE
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@deptno=10
+POSTHOOK: Input: default@mv1_part_n2@deptno=20
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@deptno=10
+POSTHOOK: Output: default@mv1_part_n2@deptno=20
+#### A masked pattern was here ####
+PREHOOK: query: explain
+select emps_n30.name, emps_n30.salary, emps_n30.commission
+from emps_n30
+join depts_n20 using (deptno)
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select emps_n30.name, emps_n30.salary, emps_n30.commission
+from emps_n30
+join depts_n20 using (deptno)
+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 3 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: default.mv1_part_n2
+                  filterExpr: deptno is not null (type: boolean)
+                  Statistics: Num rows: 5 Data size: 505 Basic stats: COMPLETE Column stats: PARTIAL
+                  Select Operator
+                    expressions: name (type: varchar(256)), salary (type: float), commission (type: int), deptno (type: int)
+                    outputColumnNames: _col0, _col1, _col2, _col3
+                    Statistics: Num rows: 5 Data size: 505 Basic stats: COMPLETE Column stats: PARTIAL
+                    Reduce Output Operator
+                      key expressions: _col3 (type: int)
+                      sort order: +
+                      Map-reduce partition columns: _col3 (type: int)
+                      Statistics: Num rows: 5 Data size: 505 Basic stats: COMPLETE Column stats: PARTIAL
+                      value expressions: _col0 (type: varchar(256)), _col1 (type: float), _col2 (type: int)
+            Execution mode: vectorized, llap
+            LLAP IO: all inputs
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: depts_n20
+                  Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+                  Select Operator
+                    expressions: deptno (type: int)
+                    outputColumnNames: _col0
+                    Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: int)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: int)
+                      Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+                    Select Operator
+                      expressions: _col0 (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+                      Group By Operator
+                        keys: _col0 (type: int)
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE
+                        Dynamic Partitioning Event Operator
+                          Target column: deptno (int)
+                          Target Input: default.mv1_part_n2
+                          Partition key expr: deptno
+                          Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE
+                          Target Vertex: Map 1
+            Execution mode: vectorized, llap
+            LLAP IO: may be used (ACID table)
+        Reducer 2 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Merge Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col3 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 5 Data size: 485 Basic stats: COMPLETE Column stats: PARTIAL
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 5 Data size: 485 Basic stats: COMPLETE Column stats: PARTIAL
+                  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 emps_n30.name, emps_n30.salary, emps_n30.commission
+from emps_n30
+join depts_n20 using (deptno)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@depts_n20
+PREHOOK: Input: default@emps_n30
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@deptno=10
+PREHOOK: Input: default@mv1_part_n2@deptno=20
+#### A masked pattern was here ####
+POSTHOOK: query: select emps_n30.name, emps_n30.salary, emps_n30.commission
+from emps_n30
+join depts_n20 using (deptno)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@depts_n20
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@deptno=10
+POSTHOOK: Input: default@mv1_part_n2@deptno=20
+#### A masked pattern was here ####
+Bill	10000.0	1000
+Bill	10000.0	250
+Eric	8000.0	500
+Sebastian	7000.0	NULL
+Theodore	10000.0	250
+PREHOOK: query: drop materialized view mv1_part_n2
+PREHOOK: type: DROP_MATERIALIZED_VIEW
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: drop materialized view mv1_part_n2
+POSTHOOK: type: DROP_MATERIALIZED_VIEW
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2
+PREHOOK: query: create materialized view mv1_part_n2 partitioned on (deptno) as
+select * from emps_n30 where empid < 200
+PREHOOK: type: CREATE_MATERIALIZED_VIEW
+PREHOOK: Input: default@emps_n30
+PREHOOK: Output: database:default
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: create materialized view mv1_part_n2 partitioned on (deptno) as
+select * from emps_n30 where empid < 200
+POSTHOOK: type: CREATE_MATERIALIZED_VIEW
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@deptno=10
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=10).commission SIMPLE [(emps_n30)emps_n30.FieldSchema(name:commission, type:int, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=10).empid SIMPLE [(emps_n30)emps_n30.FieldSchema(name:empid, type:int, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=10).name SIMPLE [(emps_n30)emps_n30.FieldSchema(name:name, type:varchar(256), comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(deptno=10).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+PREHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+PREHOOK: type: ANALYZE_TABLE
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@deptno=10
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2@deptno=10
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+POSTHOOK: type: ANALYZE_TABLE
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@deptno=10
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@deptno=10
+#### A masked pattern was here ####
+PREHOOK: query: explain
+select * from emps_n30 where empid > 120
+union all select * from emps_n30 where empid < 150
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select * from emps_n30 where empid > 120
+union all select * from emps_n30 where empid < 150
+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:
+        Map 1 <- Union 2 (CONTAINS)
+        Map 3 <- Union 2 (CONTAINS)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: emps_n30
+                  filterExpr: (empid > 120) (type: boolean)
+                  Statistics: Num rows: 5 Data size: 530 Basic stats: COMPLETE Column stats: COMPLETE
+                  Filter Operator
+                    predicate: (empid > 120) (type: boolean)
+                    Statistics: Num rows: 1 Data size: 106 Basic stats: COMPLETE Column stats: COMPLETE
+                    Select Operator
+                      expressions: empid (type: int), deptno (type: int), name (type: varchar(256)), salary (type: float), commission (type: int)
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                      Statistics: Num rows: 1 Data size: 106 Basic stats: COMPLETE Column stats: COMPLETE
+                      File Output Operator
+                        compressed: false
+                        Statistics: Num rows: 5 Data size: 526 Basic stats: COMPLETE Column stats: COMPLETE
+                        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
+            Execution mode: vectorized, llap
+            LLAP IO: may be used (ACID table)
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: default.mv1_part_n2
+                  filterExpr: (empid < 150) (type: boolean)
+                  Statistics: Num rows: 4 Data size: 420 Basic stats: COMPLETE Column stats: COMPLETE
+                  Filter Operator
+                    predicate: (empid < 150) (type: boolean)
+                    Statistics: Num rows: 4 Data size: 420 Basic stats: COMPLETE Column stats: COMPLETE
+                    Select Operator
+                      expressions: empid (type: int), deptno (type: int), name (type: varchar(256)), salary (type: float), commission (type: int)
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                      Statistics: Num rows: 4 Data size: 420 Basic stats: COMPLETE Column stats: COMPLETE
+                      File Output Operator
+                        compressed: false
+                        Statistics: Num rows: 5 Data size: 526 Basic stats: COMPLETE Column stats: COMPLETE
+                        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
+            Execution mode: vectorized, llap
+            LLAP IO: all inputs
+        Union 2 
+            Vertex: Union 2
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select * from emps_n30 where empid > 120
+union all select * from emps_n30 where empid < 150
+PREHOOK: type: QUERY
+PREHOOK: Input: default@emps_n30
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@deptno=10
+#### A masked pattern was here ####
+POSTHOOK: query: select * from emps_n30 where empid > 120
+union all select * from emps_n30 where empid < 150
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@deptno=10
+#### A masked pattern was here ####
+100	10	Bill	10000.0	1000
+110	10	Theodore	10000.0	250
+120	10	Bill	10000.0	250
+150	10	Sebastian	7000.0	NULL
+200	20	Eric	8000.0	500
+PREHOOK: query: drop materialized view mv1_part_n2
+PREHOOK: type: DROP_MATERIALIZED_VIEW
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: drop materialized view mv1_part_n2
+POSTHOOK: type: DROP_MATERIALIZED_VIEW
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2
+PREHOOK: query: create materialized view mv1_part_n2 partitioned on (name) as
+select name, salary from emps_n30 group by name, salary
+PREHOOK: type: CREATE_MATERIALIZED_VIEW
+PREHOOK: Input: default@emps_n30
+PREHOOK: Output: database:default
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: create materialized view mv1_part_n2 partitioned on (name) as
+select name, salary from emps_n30 group by name, salary
+POSTHOOK: type: CREATE_MATERIALIZED_VIEW
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@name=Bill
+POSTHOOK: Output: default@mv1_part_n2@name=Eric
+POSTHOOK: Output: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Output: default@mv1_part_n2@name=Theodore
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Bill).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Eric).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Sebastian).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Theodore).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+PREHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+PREHOOK: type: ANALYZE_TABLE
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@name=Bill
+PREHOOK: Input: default@mv1_part_n2@name=Eric
+PREHOOK: Input: default@mv1_part_n2@name=Sebastian
+PREHOOK: Input: default@mv1_part_n2@name=Theodore
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2@name=Bill
+PREHOOK: Output: default@mv1_part_n2@name=Eric
+PREHOOK: Output: default@mv1_part_n2@name=Sebastian
+PREHOOK: Output: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+POSTHOOK: type: ANALYZE_TABLE
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@name=Bill
+POSTHOOK: Input: default@mv1_part_n2@name=Eric
+POSTHOOK: Input: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Input: default@mv1_part_n2@name=Theodore
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@name=Bill
+POSTHOOK: Output: default@mv1_part_n2@name=Eric
+POSTHOOK: Output: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Output: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+PREHOOK: query: explain
+select name, salary from emps_n30 group by name, salary
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select name, salary from emps_n30 group by name, salary
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        TableScan
+          alias: default.mv1_part_n2
+          Select Operator
+            expressions: name (type: varchar(256)), salary (type: float)
+            outputColumnNames: _col0, _col1
+            ListSink
+
+PREHOOK: query: select name, salary from emps_n30 group by name, salary
+PREHOOK: type: QUERY
+PREHOOK: Input: default@emps_n30
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@name=Bill
+PREHOOK: Input: default@mv1_part_n2@name=Eric
+PREHOOK: Input: default@mv1_part_n2@name=Sebastian
+PREHOOK: Input: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+POSTHOOK: query: select name, salary from emps_n30 group by name, salary
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@name=Bill
+POSTHOOK: Input: default@mv1_part_n2@name=Eric
+POSTHOOK: Input: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Input: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+Bill	10000.0
+Eric	8000.0
+Sebastian	7000.0
+Theodore	10000.0
+PREHOOK: query: drop materialized view mv1_part_n2
+PREHOOK: type: DROP_MATERIALIZED_VIEW
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: drop materialized view mv1_part_n2
+POSTHOOK: type: DROP_MATERIALIZED_VIEW
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2
+PREHOOK: query: create materialized view mv1_part_n2 partitioned on (name) as
+select name, salary from emps_n30 group by name, salary
+PREHOOK: type: CREATE_MATERIALIZED_VIEW
+PREHOOK: Input: default@emps_n30
+PREHOOK: Output: database:default
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: create materialized view mv1_part_n2 partitioned on (name) as
+select name, salary from emps_n30 group by name, salary
+POSTHOOK: type: CREATE_MATERIALIZED_VIEW
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@name=Bill
+POSTHOOK: Output: default@mv1_part_n2@name=Eric
+POSTHOOK: Output: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Output: default@mv1_part_n2@name=Theodore
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Bill).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Eric).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Sebastian).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Theodore).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+PREHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+PREHOOK: type: ANALYZE_TABLE
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@name=Bill
+PREHOOK: Input: default@mv1_part_n2@name=Eric
+PREHOOK: Input: default@mv1_part_n2@name=Sebastian
+PREHOOK: Input: default@mv1_part_n2@name=Theodore
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2@name=Bill
+PREHOOK: Output: default@mv1_part_n2@name=Eric
+PREHOOK: Output: default@mv1_part_n2@name=Sebastian
+PREHOOK: Output: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+POSTHOOK: type: ANALYZE_TABLE
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@name=Bill
+POSTHOOK: Input: default@mv1_part_n2@name=Eric
+POSTHOOK: Input: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Input: default@mv1_part_n2@name=Theodore
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@name=Bill
+POSTHOOK: Output: default@mv1_part_n2@name=Eric
+POSTHOOK: Output: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Output: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+PREHOOK: query: explain
+select name from emps_n30 group by name
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select name from emps_n30 group by name
+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)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: default.mv1_part_n2
+                  Statistics: Num rows: 4 Data size: 1376 Basic stats: COMPLETE Column stats: COMPLETE
+                  Select Operator
+                    expressions: name (type: varchar(256))
+                    outputColumnNames: name
+                    Statistics: Num rows: 4 Data size: 1376 Basic stats: COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      keys: name (type: varchar(256))
+                      mode: hash
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 2 Data size: 680 Basic stats: COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: varchar(256))
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: varchar(256))
+                        Statistics: Num rows: 2 Data size: 680 Basic stats: COMPLETE Column stats: COMPLETE
+            Execution mode: vectorized, llap
+            LLAP IO: all inputs
+        Reducer 2 
+            Execution mode: vectorized, llap
+            Reduce Operator Tree:
+              Group By Operator
+                keys: KEY._col0 (type: varchar(256))
+                mode: mergepartial
+                outputColumnNames: _col0
+                Statistics: Num rows: 2 Data size: 680 Basic stats: COMPLETE Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 2 Data size: 680 Basic stats: COMPLETE Column stats: COMPLETE
+                  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 name from emps_n30 group by name
+PREHOOK: type: QUERY
+PREHOOK: Input: default@emps_n30
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@name=Bill
+PREHOOK: Input: default@mv1_part_n2@name=Eric
+PREHOOK: Input: default@mv1_part_n2@name=Sebastian
+PREHOOK: Input: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+POSTHOOK: query: select name from emps_n30 group by name
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@name=Bill
+POSTHOOK: Input: default@mv1_part_n2@name=Eric
+POSTHOOK: Input: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Input: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+Bill
+Eric
+Sebastian
+Theodore
+PREHOOK: query: drop materialized view mv1_part_n2
+PREHOOK: type: DROP_MATERIALIZED_VIEW
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: drop materialized view mv1_part_n2
+POSTHOOK: type: DROP_MATERIALIZED_VIEW
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2
+PREHOOK: query: create materialized view mv1_part_n2 partitioned on (name) as
+select name, salary from emps_n30 where deptno = 10 group by name, salary
+PREHOOK: type: CREATE_MATERIALIZED_VIEW
+PREHOOK: Input: default@emps_n30
+PREHOOK: Output: database:default
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: create materialized view mv1_part_n2 partitioned on (name) as
+select name, salary from emps_n30 where deptno = 10 group by name, salary
+POSTHOOK: type: CREATE_MATERIALIZED_VIEW
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@name=Bill
+POSTHOOK: Output: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Output: default@mv1_part_n2@name=Theodore
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Bill).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Sebastian).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Theodore).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+PREHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+PREHOOK: type: ANALYZE_TABLE
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@name=Bill
+PREHOOK: Input: default@mv1_part_n2@name=Sebastian
+PREHOOK: Input: default@mv1_part_n2@name=Theodore
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2@name=Bill
+PREHOOK: Output: default@mv1_part_n2@name=Sebastian
+PREHOOK: Output: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+POSTHOOK: type: ANALYZE_TABLE
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@name=Bill
+POSTHOOK: Input: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Input: default@mv1_part_n2@name=Theodore
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@name=Bill
+POSTHOOK: Output: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Output: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+PREHOOK: query: explain
+select name from emps_n30 where deptno = 10 group by name
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select name from emps_n30 where deptno = 10 group by name
+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)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: default.mv1_part_n2
+                  Statistics: Num rows: 3 Data size: 1032 Basic stats: COMPLETE Column stats: COMPLETE
+                  Select Operator
+                    expressions: name (type: varchar(256))
+                    outputColumnNames: name
+                    Statistics: Num rows: 3 Data size: 1032 Basic stats: COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      keys: name (type: varchar(256))
+                      mode: hash
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 1 Data size: 340 Basic stats: COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: varchar(256))
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: varchar(256))
+                        Statistics: Num rows: 1 Data size: 340 Basic stats: COMPLETE Column stats: COMPLETE
+            Execution mode: vectorized, llap
+            LLAP IO: all inputs
+        Reducer 2 
+            Execution mode: vectorized, llap
+            Reduce Operator Tree:
+              Group By Operator
+                keys: KEY._col0 (type: varchar(256))
+                mode: mergepartial
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 340 Basic stats: COMPLETE Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 340 Basic stats: COMPLETE Column stats: COMPLETE
+                  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 name from emps_n30 where deptno = 10 group by name
+PREHOOK: type: QUERY
+PREHOOK: Input: default@emps_n30
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@name=Bill
+PREHOOK: Input: default@mv1_part_n2@name=Sebastian
+PREHOOK: Input: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+POSTHOOK: query: select name from emps_n30 where deptno = 10 group by name
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@name=Bill
+POSTHOOK: Input: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Input: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+Bill
+Sebastian
+Theodore
+PREHOOK: query: drop materialized view mv1_part_n2
+PREHOOK: type: DROP_MATERIALIZED_VIEW
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: drop materialized view mv1_part_n2
+POSTHOOK: type: DROP_MATERIALIZED_VIEW
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2
+PREHOOK: query: create materialized view mv1_part_n2 partitioned on (name) as
+select name, salary, count(*) as c, sum(empid) as s
+from emps_n30 group by name, salary
+PREHOOK: type: CREATE_MATERIALIZED_VIEW
+PREHOOK: Input: default@emps_n30
+PREHOOK: Output: database:default
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: create materialized view mv1_part_n2 partitioned on (name) as
+select name, salary, count(*) as c, sum(empid) as s
+from emps_n30 group by name, salary
+POSTHOOK: type: CREATE_MATERIALIZED_VIEW
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@name=Bill
+POSTHOOK: Output: default@mv1_part_n2@name=Eric
+POSTHOOK: Output: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Output: default@mv1_part_n2@name=Theodore
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Bill).c EXPRESSION [(emps_n30)emps_n30.null, ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Bill).s EXPRESSION [(emps_n30)emps_n30.FieldSchema(name:empid, type:int, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Bill).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Eric).c EXPRESSION [(emps_n30)emps_n30.null, ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Eric).s EXPRESSION [(emps_n30)emps_n30.FieldSchema(name:empid, type:int, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Eric).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Sebastian).c EXPRESSION [(emps_n30)emps_n30.null, ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Sebastian).s EXPRESSION [(emps_n30)emps_n30.FieldSchema(name:empid, type:int, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Sebastian).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Theodore).c EXPRESSION [(emps_n30)emps_n30.null, ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Theodore).s EXPRESSION [(emps_n30)emps_n30.FieldSchema(name:empid, type:int, comment:null), ]
+POSTHOOK: Lineage: mv1_part_n2 PARTITION(name=Theodore).salary SIMPLE [(emps_n30)emps_n30.FieldSchema(name:salary, type:float, comment:null), ]
+PREHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+PREHOOK: type: ANALYZE_TABLE
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@name=Bill
+PREHOOK: Input: default@mv1_part_n2@name=Eric
+PREHOOK: Input: default@mv1_part_n2@name=Sebastian
+PREHOOK: Input: default@mv1_part_n2@name=Theodore
+PREHOOK: Output: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2@name=Bill
+PREHOOK: Output: default@mv1_part_n2@name=Eric
+PREHOOK: Output: default@mv1_part_n2@name=Sebastian
+PREHOOK: Output: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table mv1_part_n2 compute statistics for columns
+POSTHOOK: type: ANALYZE_TABLE
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@name=Bill
+POSTHOOK: Input: default@mv1_part_n2@name=Eric
+POSTHOOK: Input: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Input: default@mv1_part_n2@name=Theodore
+POSTHOOK: Output: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2@name=Bill
+POSTHOOK: Output: default@mv1_part_n2@name=Eric
+POSTHOOK: Output: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Output: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+PREHOOK: query: explain
+select name from emps_n30 group by name
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select name from emps_n30 group by name
+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)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: default.mv1_part_n2
+                  Statistics: Num rows: 4 Data size: 1440 Basic stats: COMPLETE Column stats: COMPLETE
+                  Select Operator
+                    expressions: name (type: varchar(256))
+                    outputColumnNames: name
+                    Statistics: Num rows: 4 Data size: 1440 Basic stats: COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      keys: name (type: varchar(256))
+                      mode: hash
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 2 Data size: 680 Basic stats: COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: varchar(256))
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: varchar(256))
+                        Statistics: Num rows: 2 Data size: 680 Basic stats: COMPLETE Column stats: COMPLETE
+            Execution mode: vectorized, llap
+            LLAP IO: all inputs
+        Reducer 2 
+            Execution mode: vectorized, llap
+            Reduce Operator Tree:
+              Group By Operator
+                keys: KEY._col0 (type: varchar(256))
+                mode: mergepartial
+                outputColumnNames: _col0
+                Statistics: Num rows: 2 Data size: 680 Basic stats: COMPLETE Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 2 Data size: 680 Basic stats: COMPLETE Column stats: COMPLETE
+                  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 name from emps_n30 group by name
+PREHOOK: type: QUERY
+PREHOOK: Input: default@emps_n30
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Input: default@mv1_part_n2@name=Bill
+PREHOOK: Input: default@mv1_part_n2@name=Eric
+PREHOOK: Input: default@mv1_part_n2@name=Sebastian
+PREHOOK: Input: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+POSTHOOK: query: select name from emps_n30 group by name
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@emps_n30
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Input: default@mv1_part_n2@name=Bill
+POSTHOOK: Input: default@mv1_part_n2@name=Eric
+POSTHOOK: Input: default@mv1_part_n2@name=Sebastian
+POSTHOOK: Input: default@mv1_part_n2@name=Theodore
+#### A masked pattern was here ####
+Bill
+Eric
+Sebastian
+Theodore
+PREHOOK: query: drop materialized view mv1_part_n2
+PREHOOK: type: DROP_MATERIALIZED_VIEW
+PREHOOK: Input: default@mv1_part_n2
+PREHOOK: Output: default@mv1_part_n2
+POSTHOOK: query: drop materialized view mv1_part_n2
+POSTHOOK: type: DROP_MATERIALIZED_VIEW
+POSTHOOK: Input: default@mv1_part_n2
+POSTHOOK: Output: default@mv1_part_n2

http://git-wip-us.apache.org/repos/asf/hive/blob/befee74d/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_part_1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_part_1.q.out b/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_part_1.q.out
index 3a2ad3d..9782cb7 100644
--- a/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_part_1.q.out
+++ b/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_part_1.q.out
@@ -19,12 +19,12 @@ POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@emps_n30
 PREHOOK: query: insert into emps_n30 values (100, 10, 'Bill', 10000, 1000), (200, 20, 'Eric', 8000, 500),
-  (150, 10, 'Sebastian', 7000, null), (110, 10, 'Theodore', 10000, 250), (110, 10, 'Bill', 10000, 250)
+  (150, 10, 'Sebastian', 7000, null), (110, 10, 'Theodore', 10000, 250), (120, 10, 'Bill', 10000, 250)
 PREHOOK: type: QUERY
 PREHOOK: Input: _dummy_database@_dummy_table
 PREHOOK: Output: default@emps_n30
 POSTHOOK: query: insert into emps_n30 values (100, 10, 'Bill', 10000, 1000), (200, 20, 'Eric', 8000, 500),
-  (150, 10, 'Sebastian', 7000, null), (110, 10, 'Theodore', 10000, 250), (110, 10, 'Bill', 10000, 250)
+  (150, 10, 'Sebastian', 7000, null), (110, 10, 'Theodore', 10000, 250), (120, 10, 'Bill', 10000, 250)
 POSTHOOK: type: QUERY
 POSTHOOK: Input: _dummy_database@_dummy_table
 POSTHOOK: Output: default@emps_n30
@@ -94,11 +94,11 @@ stored as orc TBLPROPERTIES ('transactional'='true')
 POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@dependents_n20
-PREHOOK: query: insert into dependents_n20 values (10, 'Michael'), (10, 'Jane')
+PREHOOK: query: insert into dependents_n20 values (10, 'Michael'), (20, 'Jane')
 PREHOOK: type: QUERY
 PREHOOK: Input: _dummy_database@_dummy_table
 PREHOOK: Output: default@dependents_n20
-POSTHOOK: query: insert into dependents_n20 values (10, 'Michael'), (10, 'Jane')
+POSTHOOK: query: insert into dependents_n20 values (10, 'Michael'), (20, 'Jane')
 POSTHOOK: type: QUERY
 POSTHOOK: Input: _dummy_database@_dummy_table
 POSTHOOK: Output: default@dependents_n20
@@ -128,11 +128,11 @@ stored as orc TBLPROPERTIES ('transactional'='true')
 POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@locations_n20
-PREHOOK: query: insert into locations_n20 values (10, 'San Francisco'), (10, 'San Diego')
+PREHOOK: query: insert into locations_n20 values (10, 'San Francisco'), (20, 'San Diego')
 PREHOOK: type: QUERY
 PREHOOK: Input: _dummy_database@_dummy_table
 PREHOOK: Output: default@locations_n20
-POSTHOOK: query: insert into locations_n20 values (10, 'San Francisco'), (10, 'San Diego')
+POSTHOOK: query: insert into locations_n20 values (10, 'San Francisco'), (20, 'San Diego')
 POSTHOOK: type: QUERY
 POSTHOOK: Input: _dummy_database@_dummy_table
 POSTHOOK: Output: default@locations_n20
@@ -234,16 +234,16 @@ STAGE PLANS:
                   Statistics: Num rows: 3 Data size: 315 Basic stats: COMPLETE Column stats: COMPLETE
                   Filter Operator
                     predicate: (empid < 120) (type: boolean)
-                    Statistics: Num rows: 3 Data size: 315 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 1 Data size: 105 Basic stats: COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: empid (type: int), name (type: varchar(256)), salary (type: float), commission (type: int), deptno (type: int)
                       outputColumnNames: _col0, _col1, _col2, _col3, _col4
-                      Statistics: Num rows: 3 Data size: 315 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 1 Data size: 105 Basic stats: COMPLETE Column stats: COMPLETE
                       Reduce Output Operator
                         key expressions: _col4 (type: int)
                         sort order: +
                         Map-reduce partition columns: _col4 (type: int)
-                        Statistics: Num rows: 3 Data size: 315 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 1 Data size: 105 Basic stats: COMPLETE Column stats: COMPLETE
                         value expressions: _col0 (type: int), _col1 (type: varchar(256)), _col2 (type: float), _col3 (type: int)
             Execution mode: llap
             LLAP IO: all inputs
@@ -289,14 +289,14 @@ STAGE PLANS:
                   0 _col4 (type: int)
                   1 _col0 (type: int)
                 outputColumnNames: _col0, _col1, _col2, _col3, _col5, _col6, _col7
-                Statistics: Num rows: 3 Data size: 594 Basic stats: COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 1 Data size: 198 Basic stats: COMPLETE Column stats: COMPLETE
                 Select Operator
                   expressions: _col5 (type: int), _col0 (type: int), _col1 (type: varchar(256)), _col2 (type: float), _col3 (type: int), _col6 (type: varchar(256)), _col7 (type: int)
                   outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6
-                  Statistics: Num rows: 3 Data size: 594 Basic stats: COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 1 Data size: 198 Basic stats: COMPLETE Column stats: COMPLETE
                   File Output Operator
                     compressed: false
-                    Statistics: Num rows: 3 Data size: 594 Basic stats: COMPLETE Column stats: COMPLETE
+                    Statistics: Num rows: 1 Data size: 198 Basic stats: COMPLETE Column stats: COMPLETE
                     table:
                         input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                         output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
@@ -327,7 +327,6 @@ POSTHOOK: Input: default@mv1_part_n2
 POSTHOOK: Input: default@mv1_part_n2@deptno=10
 #### A masked pattern was here ####
 10	100	Bill	10000.0	1000	Sales	10
-10	110	Bill	10000.0	250	Sales	10
 10	110	Theodore	10000.0	250	Sales	10
 PREHOOK: query: drop materialized view mv1_part_n2
 PREHOOK: type: DROP_MATERIALIZED_VIEW
@@ -389,90 +388,20 @@ from emps_n30
 join depts_n20 using (deptno)
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
+  Stage-0 is a root stage
 
 STAGE PLANS:
-  Stage: Stage-1
-    Tez
-#### A masked pattern was here ####
-      Edges:
-        Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 3 (SIMPLE_EDGE)
-#### A masked pattern was here ####
-      Vertices:
-        Map 1 
-            Map Operator Tree:
-                TableScan
-                  alias: default.mv1_part_n2
-                  filterExpr: deptno is not null (type: boolean)
-                  Statistics: Num rows: 5 Data size: 505 Basic stats: COMPLETE Column stats: PARTIAL
-                  Select Operator
-                    expressions: name (type: varchar(256)), salary (type: float), commission (type: int), deptno (type: int)
-                    outputColumnNames: _col0, _col1, _col2, _col3
-                    Statistics: Num rows: 5 Data size: 505 Basic stats: COMPLETE Column stats: PARTIAL
-                    Reduce Output Operator
-                      key expressions: _col3 (type: int)
-                      sort order: +
-                      Map-reduce partition columns: _col3 (type: int)
-                      Statistics: Num rows: 5 Data size: 505 Basic stats: COMPLETE Column stats: PARTIAL
-                      value expressions: _col0 (type: varchar(256)), _col1 (type: float), _col2 (type: int)
-            Execution mode: llap
-            LLAP IO: all inputs
-        Map 3 
-            Map Operator Tree:
-                TableScan
-                  alias: depts_n20
-                  Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
-                  Select Operator
-                    expressions: deptno (type: int)
-                    outputColumnNames: _col0
-                    Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
-                    Reduce Output Operator
-                      key expressions: _col0 (type: int)
-                      sort order: +
-                      Map-reduce partition columns: _col0 (type: int)
-                      Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
-                    Select Operator
-                      expressions: _col0 (type: int)
-                      outputColumnNames: _col0
-                      Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
-                      Group By Operator
-                        keys: _col0 (type: int)
-                        mode: hash
-                        outputColumnNames: _col0
-                        Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE
-                        Dynamic Partitioning Event Operator
-                          Target column: deptno (int)
-                          Target Input: default.mv1_part_n2
-                          Partition key expr: deptno
-                          Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE
-                          Target Vertex: Map 1
-            Execution mode: llap
-            LLAP IO: may be used (ACID table)
-        Reducer 2 
-            Execution mode: llap
-            Reduce Operator Tree:
-              Merge Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 _col3 (type: int)
-                  1 _col0 (type: int)
-                outputColumnNames: _col0, _col1, _col2
-                Statistics: Num rows: 5 Data size: 485 Basic stats: COMPLETE Column stats: PARTIAL
-                File Output Operator
-                  compressed: false
-                  Statistics: Num rows: 5 Data size: 485 Basic stats: COMPLETE Column stats: PARTIAL
-                  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
+        TableScan
+          alias: default.mv1_part_n2
+          filterExpr: deptno is not null (type: boolean)
+          Select Operator
+            expressions: name (type: varchar(256)), salary (type: float), commission (type: int)
+            outputColumnNames: _col0, _col1, _col2
+            ListSink
 
 PREHOOK: query: select emps_n30.name, emps_n30.salary, emps_n30.commission
 from emps_n30
@@ -628,8 +557,8 @@ POSTHOOK: Input: default@mv1_part_n2
 POSTHOOK: Input: default@mv1_part_n2@deptno=10
 #### A masked pattern was here ####
 100	10	Bill	10000.0	1000
-110	10	Bill	10000.0	250
 110	10	Theodore	10000.0	250
+120	10	Bill	10000.0	250
 150	10	Sebastian	7000.0	NULL
 200	20	Eric	8000.0	500
 PREHOOK: query: drop materialized view mv1_part_n2

http://git-wip-us.apache.org/repos/asf/hive/blob/befee74d/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_part_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_part_2.q.out b/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_part_2.q.out
index d39180e..b3c7e1f 100644
--- a/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_part_2.q.out
+++ b/ql/src/test/results/clientpositive/llap/materialized_view_rewrite_part_2.q.out
@@ -598,7 +598,8 @@ STAGE PLANS:
     Tez
 #### A masked pattern was here ####
       Edges:
-        Reducer 2 <- Map 1 (SIMPLE_EDGE)
+        Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 4 (SIMPLE_EDGE)
+        Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -613,22 +614,69 @@ STAGE PLANS:
                     Select Operator
                       expressions: deptno (type: int)
                       outputColumnNames: _col0
-                      Statistics: Num rows: 5 Data size: 40 Basic stats: COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 5 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 5 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
+            Execution mode: llap
+            LLAP IO: all inputs
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: depts_n00
+                  Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+                  Select Operator
+                    expressions: deptno (type: int)
+                    outputColumnNames: _col0
+                    Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: int)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: int)
+                      Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+                    Select Operator
+                      expressions: _col0 (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
                       Group By Operator
                         keys: _col0 (type: int)
                         mode: hash
                         outputColumnNames: _col0
-                        Statistics: Num rows: 2 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 2 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE
+                        Dynamic Partitioning Event Operator
+                          Target column: deptno (int)
+                          Target Input: default.mv1_part_n0
+                          Partition key expr: deptno
+                          Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: COMPLETE
+                          Target Vertex: Map 1
             Execution mode: llap
-            LLAP IO: all inputs
+            LLAP IO: may be used (ACID table)
         Reducer 2 
             Execution mode: llap
             Reduce Operator Tree:
+              Merge Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col0 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col1
+                Statistics: Num rows: 5 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
+                Group By Operator
+                  keys: _col1 (type: int)
+                  mode: hash
+                  outputColumnNames: _col0
+                  Statistics: Num rows: 2 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE
+                  Reduce Output Operator
+                    key expressions: _col0 (type: int)
+                    sort order: +
+                    Map-reduce partition columns: _col0 (type: int)
+                    Statistics: Num rows: 2 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE
+        Reducer 3 
+            Execution mode: llap
+            Reduce Operator Tree:
               Group By Operator
                 keys: KEY._col0 (type: int)
                 mode: mergepartial

http://git-wip-us.apache.org/repos/asf/hive/blob/befee74d/ql/src/test/results/clientpositive/macro.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/macro.q.out b/ql/src/test/results/clientpositive/macro.q.out
index 70281ac..abd8c0e 100644
--- a/ql/src/test/results/clientpositive/macro.q.out
+++ b/ql/src/test/results/clientpositive/macro.q.out
@@ -41,7 +41,7 @@ PREHOOK: query: EXPLAIN EXTENDED SELECT SIGMOID(2) FROM src LIMIT 1
 PREHOOK: type: QUERY
 POSTHOOK: query: EXPLAIN EXTENDED SELECT SIGMOID(2) FROM src LIMIT 1
 POSTHOOK: type: QUERY
-OPTIMIZED SQL: SELECT CAST(0.8807970779778823 AS DOUBLE) AS `_o__c0`
+OPTIMIZED SQL: SELECT CAST(0.8807970779778823 AS DOUBLE) AS `$f0`
 FROM `default`.`src`
 LIMIT 1
 STAGE DEPENDENCIES:
@@ -114,7 +114,7 @@ PREHOOK: query: EXPLAIN EXTENDED SELECT FIXED_NUMBER() + 1 FROM src LIMIT 1
 PREHOOK: type: QUERY
 POSTHOOK: query: EXPLAIN EXTENDED SELECT FIXED_NUMBER() + 1 FROM src LIMIT 1
 POSTHOOK: type: QUERY
-OPTIMIZED SQL: SELECT CAST(2 AS INTEGER) AS `_o__c0`
+OPTIMIZED SQL: SELECT CAST(2 AS INTEGER) AS `$f0`
 FROM `default`.`src`
 LIMIT 1
 STAGE DEPENDENCIES:
@@ -214,7 +214,7 @@ PREHOOK: query: EXPLAIN EXTENDED SELECT SIMPLE_ADD(1, 9) FROM src LIMIT 1
 PREHOOK: type: QUERY
 POSTHOOK: query: EXPLAIN EXTENDED SELECT SIMPLE_ADD(1, 9) FROM src LIMIT 1
 POSTHOOK: type: QUERY
-OPTIMIZED SQL: SELECT CAST(10 AS INTEGER) AS `_o__c0`
+OPTIMIZED SQL: SELECT CAST(10 AS INTEGER) AS `$f0`
 FROM `default`.`src`
 LIMIT 1
 STAGE DEPENDENCIES:

http://git-wip-us.apache.org/repos/asf/hive/blob/befee74d/ql/src/test/results/clientpositive/spark/list_bucket_dml_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/list_bucket_dml_2.q.out b/ql/src/test/results/clientpositive/spark/list_bucket_dml_2.q.out
index a2a961c..9584902 100644
--- a/ql/src/test/results/clientpositive/spark/list_bucket_dml_2.q.out
+++ b/ql/src/test/results/clientpositive/spark/list_bucket_dml_2.q.out
@@ -307,7 +307,7 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain extended
 select * from list_bucketing_static_part_n4 where ds = '2008-04-08' and  hr = '11' and key = '484' and value = 'val_484'
 POSTHOOK: type: QUERY
-OPTIMIZED SQL: SELECT CAST('484' AS STRING) AS `key`, CAST('val_484' AS STRING) AS `value`, CAST('2008-04-08' AS STRING) AS `ds`, CAST('11' AS STRING) AS `hr`
+OPTIMIZED SQL: SELECT CAST('484' AS STRING) AS `$f0`, CAST('val_484' AS STRING) AS `$f1`, CAST('2008-04-08' AS STRING) AS `$f2`, CAST('11' AS STRING) AS `$f3`
 FROM `default`.`list_bucketing_static_part_n4`
 WHERE `ds` = '2008-04-08' AND `hr` = '11' AND `key` = '484' AND `value` = 'val_484'
 STAGE DEPENDENCIES:


Mime
View raw message