http://git-wip-us.apache.org/repos/asf/hive/blob/c695c70b/ql/src/test/results/clientpositive/materialized_view_rewrite_4.q.out
----------------------------------------------------------------------
diff --git 
a/ql/src/test/results/clientpositive/materialized_view_rewrite_4.q.out 
b/ql/src/test/results/clientpositive/materialized_view_rewrite_4.q.out
deleted file mode 100644
index 7301571..0000000
--- a/ql/src/test/results/clientpositive/materialized_view_rewrite_4.q.out
+++ /dev/null
@@ -1,944 +0,0 @@
-PREHOOK: query: create table emps (
-  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
-POSTHOOK: query: create table emps (
-  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
-PREHOOK: query: insert into emps 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)
-PREHOOK: type: QUERY
-PREHOOK: Input: _dummy_database@_dummy_table
-PREHOOK: Output: default@emps
-POSTHOOK: query: insert into emps 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)
-POSTHOOK: type: QUERY
-POSTHOOK: Input: _dummy_database@_dummy_table
-POSTHOOK: Output: default@emps
-POSTHOOK: Lineage: emps.commission SCRIPT []
-POSTHOOK: Lineage: emps.deptno SCRIPT []
-POSTHOOK: Lineage: emps.empid SCRIPT []
-POSTHOOK: Lineage: emps.name SCRIPT []
-POSTHOOK: Lineage: emps.salary SCRIPT []
-PREHOOK: query: analyze table emps compute statistics for columns
-PREHOOK: type: QUERY
-PREHOOK: Input: default@emps
-PREHOOK: Output: default@emps
-#### A masked pattern was here ####
-POSTHOOK: query: analyze table emps compute statistics for columns
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@emps
-POSTHOOK: Output: default@emps
-#### A masked pattern was here ####
-PREHOOK: query: create table depts (
-  deptno int,
-  name varchar(256),
-  locationid int)
-stored as orc TBLPROPERTIES ('transactional'='true')
-PREHOOK: type: CREATETABLE
-PREHOOK: Output: database:default
-PREHOOK: Output: default@depts
-POSTHOOK: query: create table depts (
-  deptno int,
-  name varchar(256),
-  locationid int)
-stored as orc TBLPROPERTIES ('transactional'='true')
-POSTHOOK: type: CREATETABLE
-POSTHOOK: Output: database:default
-POSTHOOK: Output: default@depts
-PREHOOK: query: insert into depts values (10, 'Sales', 10), (30, 'Marketing', 
null), (20, 'HR', 20)
-PREHOOK: type: QUERY
-PREHOOK: Input: _dummy_database@_dummy_table
-PREHOOK: Output: default@depts
-POSTHOOK: query: insert into depts values (10, 'Sales', 10), (30, 'Marketing', 
null), (20, 'HR', 20)
-POSTHOOK: type: QUERY
-POSTHOOK: Input: _dummy_database@_dummy_table
-POSTHOOK: Output: default@depts
-POSTHOOK: Lineage: depts.deptno SCRIPT []
-POSTHOOK: Lineage: depts.locationid SCRIPT []
-POSTHOOK: Lineage: depts.name SCRIPT []
-PREHOOK: query: analyze table depts compute statistics for columns
-PREHOOK: type: QUERY
-PREHOOK: Input: default@depts
-PREHOOK: Output: default@depts
-#### A masked pattern was here ####
-POSTHOOK: query: analyze table depts compute statistics for columns
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@depts
-POSTHOOK: Output: default@depts
-#### A masked pattern was here ####
-PREHOOK: query: create table dependents (
-  empid int,
-  name varchar(256))
-stored as orc TBLPROPERTIES ('transactional'='true')
-PREHOOK: type: CREATETABLE
-PREHOOK: Output: database:default
-PREHOOK: Output: default@dependents
-POSTHOOK: query: create table dependents (
-  empid int,
-  name varchar(256))
-stored as orc TBLPROPERTIES ('transactional'='true')
-POSTHOOK: type: CREATETABLE
-POSTHOOK: Output: database:default
-POSTHOOK: Output: default@dependents
-PREHOOK: query: insert into dependents values (10, 'Michael'), (10, 'Jane')
-PREHOOK: type: QUERY
-PREHOOK: Input: _dummy_database@_dummy_table
-PREHOOK: Output: default@dependents
-POSTHOOK: query: insert into dependents values (10, 'Michael'), (10, 'Jane')
-POSTHOOK: type: QUERY
-POSTHOOK: Input: _dummy_database@_dummy_table
-POSTHOOK: Output: default@dependents
-POSTHOOK: Lineage: dependents.empid SCRIPT []
-POSTHOOK: Lineage: dependents.name SCRIPT []
-PREHOOK: query: analyze table dependents compute statistics for columns
-PREHOOK: type: QUERY
-PREHOOK: Input: default@dependents
-PREHOOK: Output: default@dependents
-#### A masked pattern was here ####
-POSTHOOK: query: analyze table dependents compute statistics for columns
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@dependents
-POSTHOOK: Output: default@dependents
-#### A masked pattern was here ####
-PREHOOK: query: create table locations (
-  locationid int,
-  name varchar(256))
-stored as orc TBLPROPERTIES ('transactional'='true')
-PREHOOK: type: CREATETABLE
-PREHOOK: Output: database:default
-PREHOOK: Output: default@locations
-POSTHOOK: query: create table locations (
-  locationid int,
-  name varchar(256))
-stored as orc TBLPROPERTIES ('transactional'='true')
-POSTHOOK: type: CREATETABLE
-POSTHOOK: Output: database:default
-POSTHOOK: Output: default@locations
-PREHOOK: query: insert into locations values (10, 'San Francisco'), (10, 'San 
Diego')
-PREHOOK: type: QUERY
-PREHOOK: Input: _dummy_database@_dummy_table
-PREHOOK: Output: default@locations
-POSTHOOK: query: insert into locations values (10, 'San Francisco'), (10, 'San 
Diego')
-POSTHOOK: type: QUERY
-POSTHOOK: Input: _dummy_database@_dummy_table
-POSTHOOK: Output: default@locations
-POSTHOOK: Lineage: locations.locationid SCRIPT []
-POSTHOOK: Lineage: locations.name SCRIPT []
-PREHOOK: query: analyze table locations compute statistics for columns
-PREHOOK: type: QUERY
-PREHOOK: Input: default@locations
-PREHOOK: Output: default@locations
-#### A masked pattern was here ####
-POSTHOOK: query: analyze table locations compute statistics for columns
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@locations
-POSTHOOK: Output: default@locations
-#### A masked pattern was here ####
-PREHOOK: query: alter table emps add constraint pk1 primary key (empid) 
disable novalidate rely
-PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
-POSTHOOK: query: alter table emps add constraint pk1 primary key (empid) 
disable novalidate rely
-POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
-PREHOOK: query: alter table depts add constraint pk2 primary key (deptno) 
disable novalidate rely
-PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
-POSTHOOK: query: alter table depts add constraint pk2 primary key (deptno) 
disable novalidate rely
-POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
-PREHOOK: query: alter table dependents add constraint pk3 primary key (empid) 
disable novalidate rely
-PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
-POSTHOOK: query: alter table dependents add constraint pk3 primary key (empid) 
disable novalidate rely
-POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
-PREHOOK: query: alter table locations add constraint pk4 primary key 
(locationid) disable novalidate rely
-PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
-POSTHOOK: query: alter table locations add constraint pk4 primary key 
(locationid) disable novalidate rely
-POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
-PREHOOK: query: alter table emps add constraint fk1 foreign key (deptno) 
references depts(deptno) disable novalidate rely
-PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
-POSTHOOK: query: alter table emps add constraint fk1 foreign key (deptno) 
references depts(deptno) disable novalidate rely
-POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
-PREHOOK: query: alter table depts add constraint fk2 foreign key (locationid) 
references locations(locationid) disable novalidate rely
-PREHOOK: type: ALTERTABLE_ADDCONSTRAINT
-POSTHOOK: query: alter table depts add constraint fk2 foreign key (locationid) 
references locations(locationid) disable novalidate rely
-POSTHOOK: type: ALTERTABLE_ADDCONSTRAINT
-PREHOOK: query: create materialized view mv1 enable rewrite as
-select name, salary, count(*) as c, sum(empid) as s
-from emps group by name, salary
-PREHOOK: type: CREATE_MATERIALIZED_VIEW
-PREHOOK: Input: default@emps
-PREHOOK: Output: database:default
-PREHOOK: Output: default@mv1
-POSTHOOK: query: create materialized view mv1 enable rewrite as
-select name, salary, count(*) as c, sum(empid) as s
-from emps group by name, salary
-POSTHOOK: type: CREATE_MATERIALIZED_VIEW
-POSTHOOK: Input: default@emps
-POSTHOOK: Output: database:default
-POSTHOOK: Output: default@mv1
-PREHOOK: query: analyze table mv1 compute statistics for columns
-PREHOOK: type: QUERY
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: analyze table mv1 compute statistics for columns
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1
-#### A masked pattern was here ####
-PREHOOK: query: explain
-select name, count(*) as c, sum(empid) as s
-from emps group by name
-PREHOOK: type: QUERY
-POSTHOOK: query: explain
-select name, count(*) as c, sum(empid) as s
-from emps 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
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            alias: default.mv1
-            Statistics: Num rows: 4 Data size: 424 Basic stats: COMPLETE 
Column stats: COMPLETE
-            Select Operator
-              expressions: name (type: varchar(256)), c (type: bigint), s 
(type: bigint)
-              outputColumnNames: name, c, s
-              Statistics: Num rows: 4 Data size: 424 Basic stats: COMPLETE 
Column stats: COMPLETE
-              Group By Operator
-                aggregations: $sum0(c), sum(s)
-                keys: name (type: varchar(256))
-                mode: hash
-                outputColumnNames: _col0, _col1, _col2
-                Statistics: Num rows: 2 Data size: 212 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: 212 Basic stats: COMPLETE 
Column stats: COMPLETE
-                  value expressions: _col1 (type: bigint), _col2 (type: bigint)
-      Reduce Operator Tree:
-        Group By Operator
-          aggregations: $sum0(VALUE._col0), sum(VALUE._col1)
-          keys: KEY._col0 (type: varchar(256))
-          mode: mergepartial
-          outputColumnNames: _col0, _col1, _col2
-          Statistics: Num rows: 2 Data size: 212 Basic stats: COMPLETE Column 
stats: COMPLETE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 2 Data size: 212 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, count(*) as c, sum(empid) as s
-from emps group by name
-PREHOOK: type: QUERY
-PREHOOK: Input: default@emps
-PREHOOK: Input: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: select name, count(*) as c, sum(empid) as s
-from emps group by name
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@emps
-POSTHOOK: Input: default@mv1
-#### A masked pattern was here ####
-Bill   2       210
-Eric   1       200
-Sebastian      1       150
-Theodore       1       110
-PREHOOK: query: drop materialized view mv1
-PREHOOK: type: DROP_MATERIALIZED_VIEW
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-POSTHOOK: query: drop materialized view mv1
-POSTHOOK: type: DROP_MATERIALIZED_VIEW
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1
-PREHOOK: query: create materialized view mv1 enable rewrite as
-select name, salary, count(*) as c, sum(empid) as s
-from emps group by name, salary
-PREHOOK: type: CREATE_MATERIALIZED_VIEW
-PREHOOK: Input: default@emps
-PREHOOK: Output: database:default
-PREHOOK: Output: default@mv1
-POSTHOOK: query: create materialized view mv1 enable rewrite as
-select name, salary, count(*) as c, sum(empid) as s
-from emps group by name, salary
-POSTHOOK: type: CREATE_MATERIALIZED_VIEW
-POSTHOOK: Input: default@emps
-POSTHOOK: Output: database:default
-POSTHOOK: Output: default@mv1
-PREHOOK: query: analyze table mv1 compute statistics for columns
-PREHOOK: type: QUERY
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: analyze table mv1 compute statistics for columns
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1
-#### A masked pattern was here ####
-PREHOOK: query: explain
-select salary, name, sum(empid) as s, count(*) as c
-from emps group by name, salary
-PREHOOK: type: QUERY
-POSTHOOK: query: explain
-select salary, name, sum(empid) as s, count(*) as c
-from emps 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
-          Statistics: Num rows: 4 Data size: 440 Basic stats: COMPLETE Column 
stats: COMPLETE
-          Select Operator
-            expressions: salary (type: float), name (type: varchar(256)), s 
(type: bigint), c (type: bigint)
-            outputColumnNames: _col0, _col1, _col2, _col3
-            Statistics: Num rows: 4 Data size: 440 Basic stats: COMPLETE 
Column stats: COMPLETE
-            ListSink
-
-PREHOOK: query: select salary, name, sum(empid) as s, count(*) as c
-from emps group by name, salary
-PREHOOK: type: QUERY
-PREHOOK: Input: default@emps
-PREHOOK: Input: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: select salary, name, sum(empid) as s, count(*) as c
-from emps group by name, salary
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@emps
-POSTHOOK: Input: default@mv1
-#### A masked pattern was here ####
-10000.0        Bill    210     2
-10000.0        Theodore        110     1
-7000.0 Sebastian       150     1
-8000.0 Eric    200     1
-PREHOOK: query: drop materialized view mv1
-PREHOOK: type: DROP_MATERIALIZED_VIEW
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-POSTHOOK: query: drop materialized view mv1
-POSTHOOK: type: DROP_MATERIALIZED_VIEW
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1
-PREHOOK: query: create materialized view mv1 enable rewrite as
-select empid, emps.deptno, count(*) as c, sum(empid) as s
-from emps join depts using (deptno)
-group by empid, emps.deptno
-PREHOOK: type: CREATE_MATERIALIZED_VIEW
-PREHOOK: Input: default@depts
-PREHOOK: Input: default@emps
-PREHOOK: Output: database:default
-PREHOOK: Output: default@mv1
-POSTHOOK: query: create materialized view mv1 enable rewrite as
-select empid, emps.deptno, count(*) as c, sum(empid) as s
-from emps join depts using (deptno)
-group by empid, emps.deptno
-POSTHOOK: type: CREATE_MATERIALIZED_VIEW
-POSTHOOK: Input: default@depts
-POSTHOOK: Input: default@emps
-POSTHOOK: Output: database:default
-POSTHOOK: Output: default@mv1
-PREHOOK: query: analyze table mv1 compute statistics for columns
-PREHOOK: type: QUERY
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: analyze table mv1 compute statistics for columns
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1
-#### A masked pattern was here ####
-PREHOOK: query: explain
-select depts.deptno, count(*) as c, sum(empid) as s
-from emps join depts using (deptno)
-group by depts.deptno
-PREHOOK: type: QUERY
-POSTHOOK: query: explain
-select depts.deptno, count(*) as c, sum(empid) as s
-from emps join depts using (deptno)
-group by depts.deptno
-POSTHOOK: type: QUERY
-STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
-
-STAGE PLANS:
-  Stage: Stage-1
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            alias: default.mv1
-            Statistics: Num rows: 4 Data size: 80 Basic stats: COMPLETE Column 
stats: COMPLETE
-            Select Operator
-              expressions: deptno (type: int), c (type: bigint), s (type: 
bigint)
-              outputColumnNames: deptno, c, s
-              Statistics: Num rows: 4 Data size: 80 Basic stats: COMPLETE 
Column stats: COMPLETE
-              Group By Operator
-                aggregations: $sum0(c), sum(s)
-                keys: deptno (type: int)
-                mode: hash
-                outputColumnNames: _col0, _col1, _col2
-                Statistics: Num rows: 2 Data size: 40 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: 40 Basic stats: COMPLETE 
Column stats: COMPLETE
-                  value expressions: _col1 (type: bigint), _col2 (type: bigint)
-      Reduce Operator Tree:
-        Group By Operator
-          aggregations: $sum0(VALUE._col0), sum(VALUE._col1)
-          keys: KEY._col0 (type: int)
-          mode: mergepartial
-          outputColumnNames: _col0, _col1, _col2
-          Statistics: Num rows: 2 Data size: 40 Basic stats: COMPLETE Column 
stats: COMPLETE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 2 Data size: 40 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 depts.deptno, count(*) as c, sum(empid) as s
-from emps join depts using (deptno)
-group by depts.deptno
-PREHOOK: type: QUERY
-PREHOOK: Input: default@depts
-PREHOOK: Input: default@emps
-PREHOOK: Input: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: select depts.deptno, count(*) as c, sum(empid) as s
-from emps join depts using (deptno)
-group by depts.deptno
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@depts
-POSTHOOK: Input: default@emps
-POSTHOOK: Input: default@mv1
-#### A masked pattern was here ####
-10     4       470
-20     1       200
-PREHOOK: query: drop materialized view mv1
-PREHOOK: type: DROP_MATERIALIZED_VIEW
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-POSTHOOK: query: drop materialized view mv1
-POSTHOOK: type: DROP_MATERIALIZED_VIEW
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1
-PREHOOK: query: create materialized view mv1 enable rewrite as
-select empid, emps.deptno, count(*) as c, sum(empid) as s
-from emps join depts using (deptno)
-where emps.deptno >= 10 group by empid, emps.deptno
-PREHOOK: type: CREATE_MATERIALIZED_VIEW
-PREHOOK: Input: default@depts
-PREHOOK: Input: default@emps
-PREHOOK: Output: database:default
-PREHOOK: Output: default@mv1
-POSTHOOK: query: create materialized view mv1 enable rewrite as
-select empid, emps.deptno, count(*) as c, sum(empid) as s
-from emps join depts using (deptno)
-where emps.deptno >= 10 group by empid, emps.deptno
-POSTHOOK: type: CREATE_MATERIALIZED_VIEW
-POSTHOOK: Input: default@depts
-POSTHOOK: Input: default@emps
-POSTHOOK: Output: database:default
-POSTHOOK: Output: default@mv1
-PREHOOK: query: analyze table mv1 compute statistics for columns
-PREHOOK: type: QUERY
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: analyze table mv1 compute statistics for columns
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1
-#### A masked pattern was here ####
-PREHOOK: query: explain
-select depts.deptno, sum(empid) as s
-from emps join depts using (deptno)
-where emps.deptno > 10 group by depts.deptno
-PREHOOK: type: QUERY
-POSTHOOK: query: explain
-select depts.deptno, sum(empid) as s
-from emps join depts using (deptno)
-where emps.deptno > 10 group by depts.deptno
-POSTHOOK: type: QUERY
-STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
-
-STAGE PLANS:
-  Stage: Stage-1
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            alias: default.mv1
-            Statistics: Num rows: 4 Data size: 48 Basic stats: COMPLETE Column 
stats: COMPLETE
-            Filter Operator
-              predicate: (deptno > 10) (type: boolean)
-              Statistics: Num rows: 4 Data size: 48 Basic stats: COMPLETE 
Column stats: COMPLETE
-              Group By Operator
-                aggregations: sum(s)
-                keys: deptno (type: int)
-                mode: hash
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 2 Data size: 24 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: 24 Basic stats: COMPLETE 
Column stats: COMPLETE
-                  value expressions: _col1 (type: bigint)
-      Reduce Operator Tree:
-        Group By Operator
-          aggregations: sum(VALUE._col0)
-          keys: KEY._col0 (type: int)
-          mode: mergepartial
-          outputColumnNames: _col0, _col1
-          Statistics: Num rows: 2 Data size: 24 Basic stats: COMPLETE Column 
stats: COMPLETE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 2 Data size: 24 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 depts.deptno, sum(empid) as s
-from emps join depts using (deptno)
-where emps.deptno > 10 group by depts.deptno
-PREHOOK: type: QUERY
-PREHOOK: Input: default@depts
-PREHOOK: Input: default@emps
-PREHOOK: Input: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: select depts.deptno, sum(empid) as s
-from emps join depts using (deptno)
-where emps.deptno > 10 group by depts.deptno
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@depts
-POSTHOOK: Input: default@emps
-POSTHOOK: Input: default@mv1
-#### A masked pattern was here ####
-20     200
-PREHOOK: query: drop materialized view mv1
-PREHOOK: type: DROP_MATERIALIZED_VIEW
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-POSTHOOK: query: drop materialized view mv1
-POSTHOOK: type: DROP_MATERIALIZED_VIEW
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1
-PREHOOK: query: create materialized view mv1 enable rewrite as
-select empid, depts.deptno, count(*) + 1 as c, sum(empid) as s
-from emps join depts using (deptno)
-where depts.deptno >= 10 group by empid, depts.deptno
-PREHOOK: type: CREATE_MATERIALIZED_VIEW
-PREHOOK: Input: default@depts
-PREHOOK: Input: default@emps
-PREHOOK: Output: database:default
-PREHOOK: Output: default@mv1
-POSTHOOK: query: create materialized view mv1 enable rewrite as
-select empid, depts.deptno, count(*) + 1 as c, sum(empid) as s
-from emps join depts using (deptno)
-where depts.deptno >= 10 group by empid, depts.deptno
-POSTHOOK: type: CREATE_MATERIALIZED_VIEW
-POSTHOOK: Input: default@depts
-POSTHOOK: Input: default@emps
-POSTHOOK: Output: database:default
-POSTHOOK: Output: default@mv1
-PREHOOK: query: analyze table mv1 compute statistics for columns
-PREHOOK: type: QUERY
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: analyze table mv1 compute statistics for columns
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1
-#### A masked pattern was here ####
-PREHOOK: query: explain
-select depts.deptno, sum(empid) + 1 as s
-from emps join depts using (deptno)
-where depts.deptno > 10 group by depts.deptno
-PREHOOK: type: QUERY
-POSTHOOK: query: explain
-select depts.deptno, sum(empid) + 1 as s
-from emps join depts using (deptno)
-where depts.deptno > 10 group by depts.deptno
-POSTHOOK: type: QUERY
-STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
-
-STAGE PLANS:
-  Stage: Stage-1
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            alias: default.mv1
-            Statistics: Num rows: 4 Data size: 48 Basic stats: COMPLETE Column 
stats: COMPLETE
-            Filter Operator
-              predicate: (deptno > 10) (type: boolean)
-              Statistics: Num rows: 4 Data size: 48 Basic stats: COMPLETE 
Column stats: COMPLETE
-              Select Operator
-                expressions: deptno (type: int), s (type: bigint)
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 4 Data size: 48 Basic stats: COMPLETE 
Column stats: COMPLETE
-                Group By Operator
-                  aggregations: sum(_col1)
-                  keys: _col0 (type: int)
-                  mode: hash
-                  outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 2 Data size: 24 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: 24 Basic stats: 
COMPLETE Column stats: COMPLETE
-                    value expressions: _col1 (type: bigint)
-      Reduce Operator Tree:
-        Group By Operator
-          aggregations: sum(VALUE._col0)
-          keys: KEY._col0 (type: int)
-          mode: mergepartial
-          outputColumnNames: _col0, _col1
-          Statistics: Num rows: 2 Data size: 24 Basic stats: COMPLETE Column 
stats: COMPLETE
-          Select Operator
-            expressions: _col0 (type: int), (_col1 + 1L) (type: bigint)
-            outputColumnNames: _col0, _col1
-            Statistics: Num rows: 2 Data size: 24 Basic stats: COMPLETE Column 
stats: COMPLETE
-            File Output Operator
-              compressed: false
-              Statistics: Num rows: 2 Data size: 24 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 depts.deptno, sum(empid) + 1 as s
-from emps join depts using (deptno)
-where depts.deptno > 10 group by depts.deptno
-PREHOOK: type: QUERY
-PREHOOK: Input: default@depts
-PREHOOK: Input: default@emps
-PREHOOK: Input: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: select depts.deptno, sum(empid) + 1 as s
-from emps join depts using (deptno)
-where depts.deptno > 10 group by depts.deptno
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@depts
-POSTHOOK: Input: default@emps
-POSTHOOK: Input: default@mv1
-#### A masked pattern was here ####
-20     201
-PREHOOK: query: drop materialized view mv1
-PREHOOK: type: DROP_MATERIALIZED_VIEW
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-POSTHOOK: query: drop materialized view mv1
-POSTHOOK: type: DROP_MATERIALIZED_VIEW
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1
-PREHOOK: query: create materialized view mv1 enable rewrite as
-select depts.name, sum(salary) as s
-from emps
-join depts on (emps.deptno = depts.deptno)
-group by depts.name
-PREHOOK: type: CREATE_MATERIALIZED_VIEW
-PREHOOK: Input: default@depts
-PREHOOK: Input: default@emps
-PREHOOK: Output: database:default
-PREHOOK: Output: default@mv1
-POSTHOOK: query: create materialized view mv1 enable rewrite as
-select depts.name, sum(salary) as s
-from emps
-join depts on (emps.deptno = depts.deptno)
-group by depts.name
-POSTHOOK: type: CREATE_MATERIALIZED_VIEW
-POSTHOOK: Input: default@depts
-POSTHOOK: Input: default@emps
-POSTHOOK: Output: database:default
-POSTHOOK: Output: default@mv1
-PREHOOK: query: analyze table mv1 compute statistics for columns
-PREHOOK: type: QUERY
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: analyze table mv1 compute statistics for columns
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1
-#### A masked pattern was here ####
-PREHOOK: query: explain
-select dependents.empid, sum(salary) as s
-from emps
-join depts on (emps.deptno = depts.deptno)
-join dependents on (depts.name = dependents.name)
-group by dependents.empid
-PREHOOK: type: QUERY
-POSTHOOK: query: explain
-select dependents.empid, sum(salary) as s
-from emps
-join depts on (emps.deptno = depts.deptno)
-join dependents on (depts.name = dependents.name)
-group by dependents.empid
-POSTHOOK: type: QUERY
-STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-2 depends on stages: Stage-1
-  Stage-0 depends on stages: Stage-2
-
-STAGE PLANS:
-  Stage: Stage-1
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            alias: default.mv1
-            Statistics: Num rows: 2 Data size: 192 Basic stats: COMPLETE 
Column stats: COMPLETE
-            Filter Operator
-              predicate: name is not null (type: boolean)
-              Statistics: Num rows: 2 Data size: 192 Basic stats: COMPLETE 
Column stats: COMPLETE
-              Select Operator
-                expressions: name (type: varchar(256)), s (type: double)
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 2 Data size: 192 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: 192 Basic stats: COMPLETE 
Column stats: COMPLETE
-                  value expressions: _col1 (type: double)
-          TableScan
-            alias: dependents
-            Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE 
Column stats: COMPLETE
-            Filter Operator
-              predicate: name is not null (type: boolean)
-              Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE 
Column stats: COMPLETE
-              Select Operator
-                expressions: empid (type: int), name (type: varchar(256))
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE 
Column stats: COMPLETE
-                Reduce Output Operator
-                  key expressions: _col1 (type: varchar(256))
-                  sort order: +
-                  Map-reduce partition columns: _col1 (type: varchar(256))
-                  Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE 
Column stats: COMPLETE
-                  value expressions: _col0 (type: int)
-      Reduce Operator Tree:
-        Join Operator
-          condition map:
-               Inner Join 0 to 1
-          keys:
-            0 _col0 (type: varchar(256))
-            1 _col1 (type: varchar(256))
-          outputColumnNames: _col1, _col2
-          Statistics: Num rows: 2 Data size: 24 Basic stats: COMPLETE Column 
stats: COMPLETE
-          Group By Operator
-            aggregations: sum(_col1)
-            keys: _col2 (type: int)
-            mode: hash
-            outputColumnNames: _col0, _col1
-            Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column 
stats: COMPLETE
-            File Output Operator
-              compressed: false
-              table:
-                  input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  serde: 
org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-
-  Stage: Stage-2
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            Reduce Output Operator
-              key expressions: _col0 (type: int)
-              sort order: +
-              Map-reduce partition columns: _col0 (type: int)
-              Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE 
Column stats: COMPLETE
-              value expressions: _col1 (type: double)
-      Reduce Operator Tree:
-        Group By Operator
-          aggregations: sum(VALUE._col0)
-          keys: KEY._col0 (type: int)
-          mode: mergepartial
-          outputColumnNames: _col0, _col1
-          Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column 
stats: COMPLETE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 1 Data size: 12 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 dependents.empid, sum(salary) as s
-from emps
-join depts on (emps.deptno = depts.deptno)
-join dependents on (depts.name = dependents.name)
-group by dependents.empid
-PREHOOK: type: QUERY
-PREHOOK: Input: default@dependents
-PREHOOK: Input: default@depts
-PREHOOK: Input: default@emps
-PREHOOK: Input: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: select dependents.empid, sum(salary) as s
-from emps
-join depts on (emps.deptno = depts.deptno)
-join dependents on (depts.name = dependents.name)
-group by dependents.empid
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@dependents
-POSTHOOK: Input: default@depts
-POSTHOOK: Input: default@emps
-POSTHOOK: Input: default@mv1
-#### A masked pattern was here ####
-PREHOOK: query: drop materialized view mv1
-PREHOOK: type: DROP_MATERIALIZED_VIEW
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-POSTHOOK: query: drop materialized view mv1
-POSTHOOK: type: DROP_MATERIALIZED_VIEW
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1
-PREHOOK: query: create materialized view mv1 enable rewrite as
-select dependents.empid, emps.deptno, count(distinct salary) as s
-from emps
-join dependents on (emps.empid = dependents.empid)
-group by dependents.empid, emps.deptno
-PREHOOK: type: CREATE_MATERIALIZED_VIEW
-PREHOOK: Input: default@dependents
-PREHOOK: Input: default@emps
-PREHOOK: Output: database:default
-PREHOOK: Output: default@mv1
-POSTHOOK: query: create materialized view mv1 enable rewrite as
-select dependents.empid, emps.deptno, count(distinct salary) as s
-from emps
-join dependents on (emps.empid = dependents.empid)
-group by dependents.empid, emps.deptno
-POSTHOOK: type: CREATE_MATERIALIZED_VIEW
-POSTHOOK: Input: default@dependents
-POSTHOOK: Input: default@emps
-POSTHOOK: Output: database:default
-POSTHOOK: Output: default@mv1
-PREHOOK: query: analyze table mv1 compute statistics for columns
-PREHOOK: type: QUERY
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: analyze table mv1 compute statistics for columns
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1
-#### A masked pattern was here ####
-PREHOOK: query: explain
-select emps.deptno, count(distinct salary) as s
-from emps
-join dependents on (emps.empid = dependents.empid)
-group by dependents.empid, emps.deptno
-PREHOOK: type: QUERY
-POSTHOOK: query: explain
-select emps.deptno, count(distinct salary) as s
-from emps
-join dependents on (emps.empid = dependents.empid)
-group by dependents.empid, emps.deptno
-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
-          Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column 
stats: COMPLETE
-          Select Operator
-            expressions: deptno (type: int), s (type: bigint)
-            outputColumnNames: _col0, _col1
-            Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column 
stats: COMPLETE
-            ListSink
-
-PREHOOK: query: select emps.deptno, count(distinct salary) as s
-from emps
-join dependents on (emps.empid = dependents.empid)
-group by dependents.empid, emps.deptno
-PREHOOK: type: QUERY
-PREHOOK: Input: default@dependents
-PREHOOK: Input: default@emps
-PREHOOK: Input: default@mv1
-#### A masked pattern was here ####
-POSTHOOK: query: select emps.deptno, count(distinct salary) as s
-from emps
-join dependents on (emps.empid = dependents.empid)
-group by dependents.empid, emps.deptno
-POSTHOOK: type: QUERY
-POSTHOOK: Input: default@dependents
-POSTHOOK: Input: default@emps
-POSTHOOK: Input: default@mv1
-#### A masked pattern was here ####
-PREHOOK: query: drop materialized view mv1
-PREHOOK: type: DROP_MATERIALIZED_VIEW
-PREHOOK: Input: default@mv1
-PREHOOK: Output: default@mv1
-POSTHOOK: query: drop materialized view mv1
-POSTHOOK: type: DROP_MATERIALIZED_VIEW
-POSTHOOK: Input: default@mv1
-POSTHOOK: Output: default@mv1

Reply via email to