You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by sz...@apache.org on 2015/04/23 04:34:30 UTC

[21/44] hive git commit: HIVE-9569: Enable more unit tests for UNION ALL [Spark Branch] (Chao via Xuefu) adding missing new files from previous commit

http://git-wip-us.apache.org/repos/asf/hive/blob/556e55ee/ql/src/test/results/clientpositive/spark/union_remove_23.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/union_remove_23.q.out b/ql/src/test/results/clientpositive/spark/union_remove_23.q.out
new file mode 100644
index 0000000..ad81510
--- /dev/null
+++ b/ql/src/test/results/clientpositive/spark/union_remove_23.q.out
@@ -0,0 +1,265 @@
+PREHOOK: query: -- This is to test the union->selectstar->filesink optimization
+-- Union of 2 map-reduce subqueries is performed followed by select star and a file sink
+-- There is no need to write the temporary results of the sub-queries, and then read them 
+-- again to process the union. The union can be removed completely. One of the sub-queries
+-- would have multiple map-reduce jobs.
+-- It does not matter, whether the output is merged or not. In this case, merging is turned
+-- off
+-- INCLUDE_HADOOP_MAJOR_VERSIONS(0.23)
+-- Since this test creates sub-directories for the output table outputTbl1, it might be easier
+-- to run the test only on hadoop 23
+
+create table inputTbl1(key string, val string) stored as textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@inputTbl1
+POSTHOOK: query: -- This is to test the union->selectstar->filesink optimization
+-- Union of 2 map-reduce subqueries is performed followed by select star and a file sink
+-- There is no need to write the temporary results of the sub-queries, and then read them 
+-- again to process the union. The union can be removed completely. One of the sub-queries
+-- would have multiple map-reduce jobs.
+-- It does not matter, whether the output is merged or not. In this case, merging is turned
+-- off
+-- INCLUDE_HADOOP_MAJOR_VERSIONS(0.23)
+-- Since this test creates sub-directories for the output table outputTbl1, it might be easier
+-- to run the test only on hadoop 23
+
+create table inputTbl1(key string, val string) stored as textfile
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@inputTbl1
+PREHOOK: query: create table outputTbl1(key string, values bigint) stored as textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@outputTbl1
+POSTHOOK: query: create table outputTbl1(key string, values bigint) stored as textfile
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@outputTbl1
+PREHOOK: query: load data local inpath '../../data/files/T1.txt' into table inputTbl1
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@inputtbl1
+POSTHOOK: query: load data local inpath '../../data/files/T1.txt' into table inputTbl1
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@inputtbl1
+PREHOOK: query: explain
+insert overwrite table outputTbl1
+SELECT *
+FROM (
+  SELECT key, count(1) as values from  
+  (SELECT a.key, b.val from inputTbl1 a join inputTbl1 b on a.key=b.key) subq group by key
+  UNION ALL
+  SELECT key, count(1) as values from inputTbl1 group by key
+) subq2
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+insert overwrite table outputTbl1
+SELECT *
+FROM (
+  SELECT key, count(1) as values from  
+  (SELECT a.key, b.val from inputTbl1 a join inputTbl1 b on a.key=b.key) subq group by key
+  UNION ALL
+  SELECT key, count(1) as values from inputTbl1 group by key
+) subq2
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 2), Map 4 (PARTITION-LEVEL SORT, 2)
+        Reducer 6 <- Map 5 (GROUP, 2)
+        Reducer 3 <- Reducer 2 (GROUP, 2)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: a
+                  Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
+                  Filter Operator
+                    predicate: key is not null (type: boolean)
+                    Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: key (type: string)
+                      sort order: +
+                      Map-reduce partition columns: key (type: string)
+                      Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: b
+                  Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
+                  Filter Operator
+                    predicate: key is not null (type: boolean)
+                    Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: key (type: string)
+                      sort order: +
+                      Map-reduce partition columns: key (type: string)
+                      Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl1
+                  Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
+                  Select Operator
+                    expressions: key (type: string)
+                    outputColumnNames: key
+                    Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
+                    Group By Operator
+                      aggregations: count(1)
+                      keys: key (type: string)
+                      mode: hash
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                        value expressions: _col1 (type: bigint)
+        Reducer 2 
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 key (type: string)
+                  1 key (type: string)
+                outputColumnNames: _col0
+                Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                Group By Operator
+                  aggregations: count(1)
+                  keys: _col0 (type: string)
+                  mode: hash
+                  outputColumnNames: _col0, _col1
+                  Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                  Reduce Output Operator
+                    key expressions: _col0 (type: string)
+                    sort order: +
+                    Map-reduce partition columns: _col0 (type: string)
+                    Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                    value expressions: _col1 (type: bigint)
+        Reducer 3 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                keys: KEY._col0 (type: string)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1
+                File Output Operator
+                  compressed: false
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      name: default.outputtbl1
+        Reducer 6 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                keys: KEY._col0 (type: string)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1
+                File Output Operator
+                  compressed: false
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      name: default.outputtbl1
+
+  Stage: Stage-0
+    Move Operator
+      tables:
+          replace: true
+          table:
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.outputtbl1
+
+PREHOOK: query: insert overwrite table outputTbl1
+SELECT *
+FROM (
+  SELECT key, count(1) as values from  
+  (SELECT a.key, b.val from inputTbl1 a join inputTbl1 b on a.key=b.key) subq group by key
+  UNION ALL
+  SELECT key, count(1) as values from inputTbl1 group by key
+) subq2
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inputtbl1
+PREHOOK: Output: default@outputtbl1
+POSTHOOK: query: insert overwrite table outputTbl1
+SELECT *
+FROM (
+  SELECT key, count(1) as values from  
+  (SELECT a.key, b.val from inputTbl1 a join inputTbl1 b on a.key=b.key) subq group by key
+  UNION ALL
+  SELECT key, count(1) as values from inputTbl1 group by key
+) subq2
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inputtbl1
+POSTHOOK: Output: default@outputtbl1
+POSTHOOK: Lineage: outputtbl1.key EXPRESSION [(inputtbl1)a.FieldSchema(name:key, type:string, comment:null), (inputtbl1)inputtbl1.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: outputtbl1.values EXPRESSION [(inputtbl1)a.null, (inputtbl1)a.null, (inputtbl1)b.null, (inputtbl1)inputtbl1.null, ]
+PREHOOK: query: desc formatted outputTbl1
+PREHOOK: type: DESCTABLE
+PREHOOK: Input: default@outputtbl1
+POSTHOOK: query: desc formatted outputTbl1
+POSTHOOK: type: DESCTABLE
+POSTHOOK: Input: default@outputtbl1
+# col_name            	data_type           	comment             
+	 	 
+key                 	string              	                    
+values              	bigint              	                    
+	 	 
+# Detailed Table Information	 	 
+Database:           	default             	 
+#### A masked pattern was here ####
+Protect Mode:       	None                	 
+Retention:          	0                   	 
+#### A masked pattern was here ####
+Table Type:         	MANAGED_TABLE       	 
+Table Parameters:	 	 
+	COLUMN_STATS_ACCURATE	false               
+	numFiles            	4                   
+	numRows             	-1                  
+	rawDataSize         	-1                  
+	totalSize           	40                  
+#### A masked pattern was here ####
+	 	 
+# Storage Information	 	 
+SerDe Library:      	org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe	 
+InputFormat:        	org.apache.hadoop.mapred.TextInputFormat	 
+OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat	 
+Compressed:         	No                  	 
+Num Buckets:        	-1                  	 
+Bucket Columns:     	[]                  	 
+Sort Columns:       	[]                  	 
+Storage Desc Params:	 	 
+	serialization.format	1                   
+PREHOOK: query: select * from outputTbl1 order by key, values
+PREHOOK: type: QUERY
+PREHOOK: Input: default@outputtbl1
+#### A masked pattern was here ####
+POSTHOOK: query: select * from outputTbl1 order by key, values
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@outputtbl1
+#### A masked pattern was here ####
+1	1
+1	1
+2	1
+2	1
+3	1
+3	1
+7	1
+7	1
+8	2
+8	4

http://git-wip-us.apache.org/repos/asf/hive/blob/556e55ee/ql/src/test/results/clientpositive/spark/union_remove_6_subq.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/union_remove_6_subq.q.out b/ql/src/test/results/clientpositive/spark/union_remove_6_subq.q.out
new file mode 100644
index 0000000..e60f039
--- /dev/null
+++ b/ql/src/test/results/clientpositive/spark/union_remove_6_subq.q.out
@@ -0,0 +1,1177 @@
+PREHOOK: query: -- This is to test the union->selectstar->filesink optimization
+-- Union of 2 subqueries is performed (all of which are mapred queries)
+-- followed by select star and a file sink in 2 output tables.
+-- The optimiaztion does not take affect since it is a multi-table insert.
+-- It does not matter, whether the output is merged or not. In this case,
+-- merging is turned off
+
+create table inputTbl1(key string, val string) stored as textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@inputTbl1
+POSTHOOK: query: -- This is to test the union->selectstar->filesink optimization
+-- Union of 2 subqueries is performed (all of which are mapred queries)
+-- followed by select star and a file sink in 2 output tables.
+-- The optimiaztion does not take affect since it is a multi-table insert.
+-- It does not matter, whether the output is merged or not. In this case,
+-- merging is turned off
+
+create table inputTbl1(key string, val string) stored as textfile
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@inputTbl1
+PREHOOK: query: create table outputTbl1(key string, values bigint) stored as textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@outputTbl1
+POSTHOOK: query: create table outputTbl1(key string, values bigint) stored as textfile
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@outputTbl1
+PREHOOK: query: create table outputTbl2(key string, values bigint) stored as textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@outputTbl2
+POSTHOOK: query: create table outputTbl2(key string, values bigint) stored as textfile
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@outputTbl2
+PREHOOK: query: load data local inpath '../../data/files/T1.txt' into table inputTbl1
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@inputtbl1
+POSTHOOK: query: load data local inpath '../../data/files/T1.txt' into table inputTbl1
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@inputtbl1
+PREHOOK: query: explain
+FROM (
+  select * from(
+  SELECT key, count(1) as values from inputTbl1 group by key
+  UNION ALL
+  SELECT key, count(1) as values from inputTbl1 group by key
+  )subq
+) a
+insert overwrite table outputTbl1 select *
+insert overwrite table outputTbl2 select *
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+FROM (
+  select * from(
+  SELECT key, count(1) as values from inputTbl1 group by key
+  UNION ALL
+  SELECT key, count(1) as values from inputTbl1 group by key
+  )subq
+) a
+insert overwrite table outputTbl1 select *
+insert overwrite table outputTbl2 select *
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-2 is a root stage
+  Stage-0 depends on stages: Stage-2
+  Stage-1 depends on stages: Stage-2
+
+STAGE PLANS:
+  Stage: Stage-2
+    Spark
+      Edges:
+        Reducer 2 <- Map 1 (GROUP, 2)
+        Reducer 4 <- Map 3 (GROUP, 2)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl1
+                  Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
+                  Select Operator
+                    expressions: key (type: string)
+                    outputColumnNames: key
+                    Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
+                    Group By Operator
+                      aggregations: count(1)
+                      keys: key (type: string)
+                      mode: hash
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                        value expressions: _col1 (type: bigint)
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl1
+                  Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
+                  Select Operator
+                    expressions: key (type: string)
+                    outputColumnNames: key
+                    Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
+                    Group By Operator
+                      aggregations: count(1)
+                      keys: key (type: string)
+                      mode: hash
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
+                        value expressions: _col1 (type: bigint)
+        Reducer 2 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                keys: KEY._col0 (type: string)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1
+                File Output Operator
+                  compressed: false
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      name: default.outputtbl1
+                File Output Operator
+                  compressed: false
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      name: default.outputtbl2
+        Reducer 4 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                keys: KEY._col0 (type: string)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1
+                File Output Operator
+                  compressed: false
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      name: default.outputtbl1
+                File Output Operator
+                  compressed: false
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      name: default.outputtbl2
+
+  Stage: Stage-0
+    Move Operator
+      tables:
+          replace: true
+          table:
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.outputtbl1
+
+  Stage: Stage-1
+    Move Operator
+      tables:
+          replace: true
+          table:
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.outputtbl2
+
+PREHOOK: query: FROM (
+  select * from(
+  SELECT key, count(1) as values from inputTbl1 group by key
+  UNION ALL
+  SELECT key, count(1) as values from inputTbl1 group by key
+  )subq
+) a
+insert overwrite table outputTbl1 select *
+insert overwrite table outputTbl2 select *
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inputtbl1
+PREHOOK: Output: default@outputtbl1
+PREHOOK: Output: default@outputtbl2
+POSTHOOK: query: FROM (
+  select * from(
+  SELECT key, count(1) as values from inputTbl1 group by key
+  UNION ALL
+  SELECT key, count(1) as values from inputTbl1 group by key
+  )subq
+) a
+insert overwrite table outputTbl1 select *
+insert overwrite table outputTbl2 select *
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inputtbl1
+POSTHOOK: Output: default@outputtbl1
+POSTHOOK: Output: default@outputtbl2
+POSTHOOK: Lineage: outputtbl1.key EXPRESSION [(inputtbl1)inputtbl1.FieldSchema(name:key, type:string, comment:null), (inputtbl1)inputtbl1.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: outputtbl1.values EXPRESSION [(inputtbl1)inputtbl1.null, (inputtbl1)inputtbl1.null, ]
+POSTHOOK: Lineage: outputtbl2.key EXPRESSION [(inputtbl1)inputtbl1.FieldSchema(name:key, type:string, comment:null), (inputtbl1)inputtbl1.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: outputtbl2.values EXPRESSION [(inputtbl1)inputtbl1.null, (inputtbl1)inputtbl1.null, ]
+PREHOOK: query: select * from outputTbl1 order by key, values
+PREHOOK: type: QUERY
+PREHOOK: Input: default@outputtbl1
+#### A masked pattern was here ####
+POSTHOOK: query: select * from outputTbl1 order by key, values
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@outputtbl1
+#### A masked pattern was here ####
+1	1
+1	1
+2	1
+2	1
+3	1
+3	1
+7	1
+7	1
+8	2
+8	2
+PREHOOK: query: select * from outputTbl2 order by key, values
+PREHOOK: type: QUERY
+PREHOOK: Input: default@outputtbl2
+#### A masked pattern was here ####
+POSTHOOK: query: select * from outputTbl2 order by key, values
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@outputtbl2
+#### A masked pattern was here ####
+1	1
+1	1
+2	1
+2	1
+3	1
+3	1
+7	1
+7	1
+8	2
+8	2
+PREHOOK: query: -- The following queries guarantee the correctness.
+explain
+select avg(c) from(
+  SELECT count(1)-200 as c from src
+  UNION ALL
+  SELECT count(1) as c from src
+)subq
+PREHOOK: type: QUERY
+POSTHOOK: query: -- The following queries guarantee the correctness.
+explain
+select avg(c) from(
+  SELECT count(1)-200 as c from src
+  UNION ALL
+  SELECT count(1) as c from src
+)subq
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 2 <- Map 1 (GROUP, 1)
+        Reducer 5 <- Map 4 (GROUP, 1)
+        Reducer 3 <- Reducer 2 (GROUP, 1), Reducer 5 (GROUP, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src
+                  Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: COMPLETE
+                  Select Operator
+                    Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      aggregations: count(1)
+                      mode: hash
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE
+                        value expressions: _col0 (type: bigint)
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: src
+                  Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: COMPLETE
+                  Select Operator
+                    Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      aggregations: count(1)
+                      mode: hash
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE
+                        value expressions: _col0 (type: bigint)
+        Reducer 2 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                mode: mergepartial
+                outputColumnNames: _col0
+                Select Operator
+                  expressions: (_col0 - 200) (type: bigint)
+                  outputColumnNames: _col0
+                  Group By Operator
+                    aggregations: avg(_col0)
+                    mode: hash
+                    outputColumnNames: _col0
+                    Reduce Output Operator
+                      sort order: 
+                      value expressions: _col0 (type: struct<count:bigint,sum:double,input:bigint>)
+        Reducer 3 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: avg(VALUE._col0)
+                mode: mergepartial
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Reducer 5 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                mode: mergepartial
+                outputColumnNames: _col0
+                Group By Operator
+                  aggregations: avg(_col0)
+                  mode: hash
+                  outputColumnNames: _col0
+                  Reduce Output Operator
+                    sort order: 
+                    value expressions: _col0 (type: struct<count:bigint,sum:double,input:bigint>)
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select avg(c) from(
+  SELECT count(1)-200 as c from src
+  UNION ALL
+  SELECT count(1) as c from src
+)subq
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select avg(c) from(
+  SELECT count(1)-200 as c from src
+  UNION ALL
+  SELECT count(1) as c from src
+)subq
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+400.0
+PREHOOK: query: explain
+select key, avg(c) over w from(
+  SELECT key, count(1)*2 as c from src group by key
+  UNION ALL
+  SELECT key, count(1) as c from src group by key
+)subq group by key, c
+WINDOW w AS (PARTITION BY key ORDER BY c ROWS UNBOUNDED PRECEDING)
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select key, avg(c) over w from(
+  SELECT key, count(1)*2 as c from src group by key
+  UNION ALL
+  SELECT key, count(1) as c from src group by key
+)subq group by key, c
+WINDOW w AS (PARTITION BY key ORDER BY c ROWS UNBOUNDED PRECEDING)
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 2 <- Map 1 (GROUP, 2)
+        Reducer 6 <- Map 5 (GROUP, 2)
+        Reducer 3 <- Reducer 2 (GROUP, 2), Reducer 6 (GROUP, 2)
+        Reducer 4 <- Reducer 3 (PARTITION-LEVEL SORT, 2)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src
+                  Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                  Select Operator
+                    expressions: key (type: string)
+                    outputColumnNames: key
+                    Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                    Group By Operator
+                      aggregations: count(1)
+                      keys: key (type: string)
+                      mode: hash
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: bigint)
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: src
+                  Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                  Select Operator
+                    expressions: key (type: string)
+                    outputColumnNames: key
+                    Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                    Group By Operator
+                      aggregations: count(1)
+                      keys: key (type: string)
+                      mode: hash
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: bigint)
+        Reducer 2 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                keys: KEY._col0 (type: string)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1
+                Select Operator
+                  expressions: _col0 (type: string), (_col1 * 2) (type: bigint)
+                  outputColumnNames: _col0, _col1
+                  Group By Operator
+                    keys: _col0 (type: string), _col1 (type: bigint)
+                    mode: hash
+                    outputColumnNames: _col0, _col1
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string), _col1 (type: bigint)
+                      sort order: ++
+                      Map-reduce partition columns: _col0 (type: string), _col1 (type: bigint)
+        Reducer 3 
+            Reduce Operator Tree:
+              Group By Operator
+                keys: KEY._col0 (type: string), KEY._col1 (type: bigint)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: string), _col1 (type: bigint)
+                  sort order: ++
+                  Map-reduce partition columns: _col0 (type: string)
+                  Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+        Reducer 4 
+            Reduce Operator Tree:
+              Select Operator
+                expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: bigint)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+                PTF Operator
+                  Function definitions:
+                      Input definition
+                        input alias: ptf_0
+                        output shape: _col0: string, _col1: bigint
+                        type: WINDOWING
+                      Windowing table definition
+                        input alias: ptf_1
+                        name: windowingtablefunction
+                        order by: _col1
+                        partition by: _col0
+                        raw input shape:
+                        window functions:
+                            window function definition
+                              alias: _wcol0
+                              arguments: _col1
+                              name: avg
+                              window function: GenericUDAFAverageEvaluatorDouble
+                              window frame: PRECEDING(MAX)~
+                  Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+                  Select Operator
+                    expressions: _col0 (type: string), _wcol0 (type: double)
+                    outputColumnNames: _col0, _col1
+                    Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+                    File Output Operator
+                      compressed: false
+                      Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+                      table:
+                          input format: org.apache.hadoop.mapred.TextInputFormat
+                          output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                          serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Reducer 6 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                keys: KEY._col0 (type: string)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1
+                Group By Operator
+                  keys: _col0 (type: string), _col1 (type: bigint)
+                  mode: hash
+                  outputColumnNames: _col0, _col1
+                  Reduce Output Operator
+                    key expressions: _col0 (type: string), _col1 (type: bigint)
+                    sort order: ++
+                    Map-reduce partition columns: _col0 (type: string), _col1 (type: bigint)
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select key, avg(c) over w from(
+  SELECT key, count(1)*2 as c from src group by key
+  UNION ALL
+  SELECT key, count(1) as c from src group by key
+)subq group by key, c
+WINDOW w AS (PARTITION BY key ORDER BY c ROWS UNBOUNDED PRECEDING)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select key, avg(c) over w from(
+  SELECT key, count(1)*2 as c from src group by key
+  UNION ALL
+  SELECT key, count(1) as c from src group by key
+)subq group by key, c
+WINDOW w AS (PARTITION BY key ORDER BY c ROWS UNBOUNDED PRECEDING)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	3.0
+0	4.5
+103	2.0
+103	3.0
+105	1.0
+105	1.5
+11	1.0
+11	1.5
+114	1.0
+114	1.5
+116	1.0
+116	1.5
+118	2.0
+118	3.0
+125	2.0
+125	3.0
+129	2.0
+129	3.0
+134	2.0
+134	3.0
+136	1.0
+136	1.5
+138	4.0
+138	6.0
+143	1.0
+143	1.5
+145	1.0
+145	1.5
+149	2.0
+149	3.0
+15	2.0
+15	3.0
+150	1.0
+150	1.5
+152	2.0
+152	3.0
+156	1.0
+156	1.5
+158	1.0
+158	1.5
+163	1.0
+163	1.5
+165	2.0
+165	3.0
+167	3.0
+167	4.5
+169	4.0
+169	6.0
+17	1.0
+17	1.5
+170	1.0
+170	1.5
+172	2.0
+172	3.0
+174	2.0
+174	3.0
+176	2.0
+176	3.0
+178	1.0
+178	1.5
+181	1.0
+181	1.5
+183	1.0
+183	1.5
+187	3.0
+187	4.5
+189	1.0
+189	1.5
+19	1.0
+19	1.5
+190	1.0
+190	1.5
+192	1.0
+192	1.5
+194	1.0
+194	1.5
+196	1.0
+196	1.5
+2	1.0
+2	1.5
+20	1.0
+20	1.5
+200	2.0
+200	3.0
+202	1.0
+202	1.5
+208	3.0
+208	4.5
+213	2.0
+213	3.0
+217	2.0
+217	3.0
+219	2.0
+219	3.0
+222	1.0
+222	1.5
+224	2.0
+224	3.0
+226	1.0
+226	1.5
+228	1.0
+228	1.5
+233	2.0
+233	3.0
+235	1.0
+235	1.5
+237	2.0
+237	3.0
+239	2.0
+239	3.0
+24	2.0
+24	3.0
+242	2.0
+242	3.0
+244	1.0
+244	1.5
+248	1.0
+248	1.5
+255	2.0
+255	3.0
+257	1.0
+257	1.5
+26	2.0
+26	3.0
+260	1.0
+260	1.5
+262	1.0
+262	1.5
+266	1.0
+266	1.5
+273	3.0
+273	4.5
+275	1.0
+275	1.5
+277	4.0
+277	6.0
+28	1.0
+28	1.5
+280	2.0
+280	3.0
+282	2.0
+282	3.0
+284	1.0
+284	1.5
+286	1.0
+286	1.5
+288	2.0
+288	3.0
+291	1.0
+291	1.5
+305	1.0
+305	1.5
+307	2.0
+307	3.0
+309	2.0
+309	3.0
+310	1.0
+310	1.5
+316	3.0
+316	4.5
+318	3.0
+318	4.5
+321	2.0
+321	3.0
+323	1.0
+323	1.5
+325	2.0
+325	3.0
+327	3.0
+327	4.5
+33	1.0
+33	1.5
+332	1.0
+332	1.5
+336	1.0
+336	1.5
+338	1.0
+338	1.5
+341	1.0
+341	1.5
+345	1.0
+345	1.5
+35	3.0
+35	4.5
+356	1.0
+356	1.5
+365	1.0
+365	1.5
+367	2.0
+367	3.0
+369	3.0
+369	4.5
+37	2.0
+37	3.0
+374	1.0
+374	1.5
+378	1.0
+378	1.5
+389	1.0
+389	1.5
+392	1.0
+392	1.5
+394	1.0
+394	1.5
+396	3.0
+396	4.5
+4	1.0
+4	1.5
+400	1.0
+400	1.5
+402	1.0
+402	1.5
+404	2.0
+404	3.0
+406	4.0
+406	6.0
+411	1.0
+411	1.5
+413	2.0
+413	3.0
+417	3.0
+417	4.5
+419	1.0
+419	1.5
+42	2.0
+42	3.0
+424	2.0
+424	3.0
+431	3.0
+431	4.5
+435	1.0
+435	1.5
+437	1.0
+437	1.5
+439	2.0
+439	3.0
+44	1.0
+44	1.5
+444	1.0
+444	1.5
+446	1.0
+446	1.5
+448	1.0
+448	1.5
+453	1.0
+453	1.5
+455	1.0
+455	1.5
+457	1.0
+457	1.5
+459	2.0
+459	3.0
+460	1.0
+460	1.5
+462	2.0
+462	3.0
+466	3.0
+466	4.5
+468	4.0
+468	6.0
+475	1.0
+475	1.5
+477	1.0
+477	1.5
+479	1.0
+479	1.5
+480	3.0
+480	4.5
+482	1.0
+482	1.5
+484	1.0
+484	1.5
+491	1.0
+491	1.5
+493	1.0
+493	1.5
+495	1.0
+495	1.5
+497	1.0
+497	1.5
+51	2.0
+51	3.0
+53	1.0
+53	1.5
+57	1.0
+57	1.5
+64	1.0
+64	1.5
+66	1.0
+66	1.5
+77	1.0
+77	1.5
+8	1.0
+8	1.5
+80	1.0
+80	1.5
+82	1.0
+82	1.5
+84	2.0
+84	3.0
+86	1.0
+86	1.5
+95	2.0
+95	3.0
+97	2.0
+97	3.0
+10	1.0
+10	1.5
+100	2.0
+100	3.0
+104	2.0
+104	3.0
+111	1.0
+111	1.5
+113	2.0
+113	3.0
+119	3.0
+119	4.5
+12	2.0
+12	3.0
+120	2.0
+120	3.0
+126	1.0
+126	1.5
+128	3.0
+128	4.5
+131	1.0
+131	1.5
+133	1.0
+133	1.5
+137	2.0
+137	3.0
+146	2.0
+146	3.0
+153	1.0
+153	1.5
+155	1.0
+155	1.5
+157	1.0
+157	1.5
+160	1.0
+160	1.5
+162	1.0
+162	1.5
+164	2.0
+164	3.0
+166	1.0
+166	1.5
+168	1.0
+168	1.5
+175	2.0
+175	3.0
+177	1.0
+177	1.5
+179	2.0
+179	3.0
+18	2.0
+18	3.0
+180	1.0
+180	1.5
+186	1.0
+186	1.5
+191	2.0
+191	3.0
+193	3.0
+193	4.5
+195	2.0
+195	3.0
+197	2.0
+197	3.0
+199	3.0
+199	4.5
+201	1.0
+201	1.5
+203	2.0
+203	3.0
+205	2.0
+205	3.0
+207	2.0
+207	3.0
+209	2.0
+209	3.0
+214	1.0
+214	1.5
+216	2.0
+216	3.0
+218	1.0
+218	1.5
+221	2.0
+221	3.0
+223	2.0
+223	3.0
+229	2.0
+229	3.0
+230	5.0
+230	7.5
+238	2.0
+238	3.0
+241	1.0
+241	1.5
+247	1.0
+247	1.5
+249	1.0
+249	1.5
+252	1.0
+252	1.5
+256	2.0
+256	3.0
+258	1.0
+258	1.5
+263	1.0
+263	1.5
+265	2.0
+265	3.0
+27	1.0
+27	1.5
+272	2.0
+272	3.0
+274	1.0
+274	1.5
+278	2.0
+278	3.0
+281	2.0
+281	3.0
+283	1.0
+283	1.5
+285	1.0
+285	1.5
+287	1.0
+287	1.5
+289	1.0
+289	1.5
+292	1.0
+292	1.5
+296	1.0
+296	1.5
+298	3.0
+298	4.5
+30	1.0
+30	1.5
+302	1.0
+302	1.5
+306	1.0
+306	1.5
+308	1.0
+308	1.5
+311	3.0
+311	4.5
+315	1.0
+315	1.5
+317	2.0
+317	3.0
+322	2.0
+322	3.0
+331	2.0
+331	3.0
+333	2.0
+333	3.0
+335	1.0
+335	1.5
+339	1.0
+339	1.5
+34	1.0
+34	1.5
+342	2.0
+342	3.0
+344	2.0
+344	3.0
+348	5.0
+348	7.5
+351	1.0
+351	1.5
+353	2.0
+353	3.0
+360	1.0
+360	1.5
+362	1.0
+362	1.5
+364	1.0
+364	1.5
+366	1.0
+366	1.5
+368	1.0
+368	1.5
+373	1.0
+373	1.5
+375	1.0
+375	1.5
+377	1.0
+377	1.5
+379	1.0
+379	1.5
+382	2.0
+382	3.0
+384	3.0
+384	4.5
+386	1.0
+386	1.5
+393	1.0
+393	1.5
+395	2.0
+395	3.0
+397	2.0
+397	3.0
+399	2.0
+399	3.0
+401	5.0
+401	7.5
+403	3.0
+403	4.5
+407	1.0
+407	1.5
+409	3.0
+409	4.5
+41	1.0
+41	1.5
+414	2.0
+414	3.0
+418	1.0
+418	1.5
+421	1.0
+421	1.5
+427	1.0
+427	1.5
+429	2.0
+429	3.0
+43	1.0
+43	1.5
+430	3.0
+430	4.5
+432	1.0
+432	1.5
+436	1.0
+436	1.5
+438	3.0
+438	4.5
+443	1.0
+443	1.5
+449	1.0
+449	1.5
+452	1.0
+452	1.5
+454	3.0
+454	4.5
+458	2.0
+458	3.0
+463	2.0
+463	3.0
+467	1.0
+467	1.5
+469	5.0
+469	7.5
+47	1.0
+47	1.5
+470	1.0
+470	1.5
+472	1.0
+472	1.5
+478	2.0
+478	3.0
+481	1.0
+481	1.5
+483	1.0
+483	1.5
+485	1.0
+485	1.5
+487	1.0
+487	1.5
+489	4.0
+489	6.0
+490	1.0
+490	1.5
+492	2.0
+492	3.0
+494	1.0
+494	1.5
+496	1.0
+496	1.5
+498	3.0
+498	4.5
+5	3.0
+5	4.5
+54	1.0
+54	1.5
+58	2.0
+58	3.0
+65	1.0
+65	1.5
+67	2.0
+67	3.0
+69	1.0
+69	1.5
+70	3.0
+70	4.5
+72	2.0
+72	3.0
+74	1.0
+74	1.5
+76	2.0
+76	3.0
+78	1.0
+78	1.5
+83	2.0
+83	3.0
+85	1.0
+85	1.5
+87	1.0
+87	1.5
+9	1.0
+9	1.5
+90	3.0
+90	4.5
+92	1.0
+92	1.5
+96	1.0
+96	1.5
+98	2.0
+98	3.0

http://git-wip-us.apache.org/repos/asf/hive/blob/556e55ee/ql/src/test/results/clientpositive/spark/union_script.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/union_script.q.out b/ql/src/test/results/clientpositive/spark/union_script.q.out
new file mode 100644
index 0000000..e044f63
--- /dev/null
+++ b/ql/src/test/results/clientpositive/spark/union_script.q.out
@@ -0,0 +1,1524 @@
+PREHOOK: query: select * from (
+  select transform(key) using 'cat' as cola from src)s order by cola
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select * from (
+  select transform(key) using 'cat' as cola from src)s order by cola
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0
+0
+0
+10
+100
+100
+103
+103
+104
+104
+105
+11
+111
+113
+113
+114
+116
+118
+118
+119
+119
+119
+12
+12
+120
+120
+125
+125
+126
+128
+128
+128
+129
+129
+131
+133
+134
+134
+136
+137
+137
+138
+138
+138
+138
+143
+145
+146
+146
+149
+149
+15
+15
+150
+152
+152
+153
+155
+156
+157
+158
+160
+162
+163
+164
+164
+165
+165
+166
+167
+167
+167
+168
+169
+169
+169
+169
+17
+170
+172
+172
+174
+174
+175
+175
+176
+176
+177
+178
+179
+179
+18
+18
+180
+181
+183
+186
+187
+187
+187
+189
+19
+190
+191
+191
+192
+193
+193
+193
+194
+195
+195
+196
+197
+197
+199
+199
+199
+2
+20
+200
+200
+201
+202
+203
+203
+205
+205
+207
+207
+208
+208
+208
+209
+209
+213
+213
+214
+216
+216
+217
+217
+218
+219
+219
+221
+221
+222
+223
+223
+224
+224
+226
+228
+229
+229
+230
+230
+230
+230
+230
+233
+233
+235
+237
+237
+238
+238
+239
+239
+24
+24
+241
+242
+242
+244
+247
+248
+249
+252
+255
+255
+256
+256
+257
+258
+26
+26
+260
+262
+263
+265
+265
+266
+27
+272
+272
+273
+273
+273
+274
+275
+277
+277
+277
+277
+278
+278
+28
+280
+280
+281
+281
+282
+282
+283
+284
+285
+286
+287
+288
+288
+289
+291
+292
+296
+298
+298
+298
+30
+302
+305
+306
+307
+307
+308
+309
+309
+310
+311
+311
+311
+315
+316
+316
+316
+317
+317
+318
+318
+318
+321
+321
+322
+322
+323
+325
+325
+327
+327
+327
+33
+331
+331
+332
+333
+333
+335
+336
+338
+339
+34
+341
+342
+342
+344
+344
+345
+348
+348
+348
+348
+348
+35
+35
+35
+351
+353
+353
+356
+360
+362
+364
+365
+366
+367
+367
+368
+369
+369
+369
+37
+37
+373
+374
+375
+377
+378
+379
+382
+382
+384
+384
+384
+386
+389
+392
+393
+394
+395
+395
+396
+396
+396
+397
+397
+399
+399
+4
+400
+401
+401
+401
+401
+401
+402
+403
+403
+403
+404
+404
+406
+406
+406
+406
+407
+409
+409
+409
+41
+411
+413
+413
+414
+414
+417
+417
+417
+418
+419
+42
+42
+421
+424
+424
+427
+429
+429
+43
+430
+430
+430
+431
+431
+431
+432
+435
+436
+437
+438
+438
+438
+439
+439
+44
+443
+444
+446
+448
+449
+452
+453
+454
+454
+454
+455
+457
+458
+458
+459
+459
+460
+462
+462
+463
+463
+466
+466
+466
+467
+468
+468
+468
+468
+469
+469
+469
+469
+469
+47
+470
+472
+475
+477
+478
+478
+479
+480
+480
+480
+481
+482
+483
+484
+485
+487
+489
+489
+489
+489
+490
+491
+492
+492
+493
+494
+495
+496
+497
+498
+498
+498
+5
+5
+5
+51
+51
+53
+54
+57
+58
+58
+64
+65
+66
+67
+67
+69
+70
+70
+70
+72
+72
+74
+76
+76
+77
+78
+8
+80
+82
+83
+83
+84
+84
+85
+86
+87
+9
+90
+90
+90
+92
+95
+95
+96
+97
+97
+98
+98
+PREHOOK: query: select * from (
+  select transform(key) using 'cat' as cola from src
+  union all
+  select transform(key) using 'cat' as cola from src) s order by cola
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select * from (
+  select transform(key) using 'cat' as cola from src
+  union all
+  select transform(key) using 'cat' as cola from src) s order by cola
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0
+0
+0
+0
+0
+0
+10
+10
+100
+100
+100
+100
+103
+103
+103
+103
+104
+104
+104
+104
+105
+105
+11
+11
+111
+111
+113
+113
+113
+113
+114
+114
+116
+116
+118
+118
+118
+118
+119
+119
+119
+119
+119
+119
+12
+12
+12
+12
+120
+120
+120
+120
+125
+125
+125
+125
+126
+126
+128
+128
+128
+128
+128
+128
+129
+129
+129
+129
+131
+131
+133
+133
+134
+134
+134
+134
+136
+136
+137
+137
+137
+137
+138
+138
+138
+138
+138
+138
+138
+138
+143
+143
+145
+145
+146
+146
+146
+146
+149
+149
+149
+149
+15
+15
+15
+15
+150
+150
+152
+152
+152
+152
+153
+153
+155
+155
+156
+156
+157
+157
+158
+158
+160
+160
+162
+162
+163
+163
+164
+164
+164
+164
+165
+165
+165
+165
+166
+166
+167
+167
+167
+167
+167
+167
+168
+168
+169
+169
+169
+169
+169
+169
+169
+169
+17
+17
+170
+170
+172
+172
+172
+172
+174
+174
+174
+174
+175
+175
+175
+175
+176
+176
+176
+176
+177
+177
+178
+178
+179
+179
+179
+179
+18
+18
+18
+18
+180
+180
+181
+181
+183
+183
+186
+186
+187
+187
+187
+187
+187
+187
+189
+189
+19
+19
+190
+190
+191
+191
+191
+191
+192
+192
+193
+193
+193
+193
+193
+193
+194
+194
+195
+195
+195
+195
+196
+196
+197
+197
+197
+197
+199
+199
+199
+199
+199
+199
+2
+2
+20
+20
+200
+200
+200
+200
+201
+201
+202
+202
+203
+203
+203
+203
+205
+205
+205
+205
+207
+207
+207
+207
+208
+208
+208
+208
+208
+208
+209
+209
+209
+209
+213
+213
+213
+213
+214
+214
+216
+216
+216
+216
+217
+217
+217
+217
+218
+218
+219
+219
+219
+219
+221
+221
+221
+221
+222
+222
+223
+223
+223
+223
+224
+224
+224
+224
+226
+226
+228
+228
+229
+229
+229
+229
+230
+230
+230
+230
+230
+230
+230
+230
+230
+230
+233
+233
+233
+233
+235
+235
+237
+237
+237
+237
+238
+238
+238
+238
+239
+239
+239
+239
+24
+24
+24
+24
+241
+241
+242
+242
+242
+242
+244
+244
+247
+247
+248
+248
+249
+249
+252
+252
+255
+255
+255
+255
+256
+256
+256
+256
+257
+257
+258
+258
+26
+26
+26
+26
+260
+260
+262
+262
+263
+263
+265
+265
+265
+265
+266
+266
+27
+27
+272
+272
+272
+272
+273
+273
+273
+273
+273
+273
+274
+274
+275
+275
+277
+277
+277
+277
+277
+277
+277
+277
+278
+278
+278
+278
+28
+28
+280
+280
+280
+280
+281
+281
+281
+281
+282
+282
+282
+282
+283
+283
+284
+284
+285
+285
+286
+286
+287
+287
+288
+288
+288
+288
+289
+289
+291
+291
+292
+292
+296
+296
+298
+298
+298
+298
+298
+298
+30
+30
+302
+302
+305
+305
+306
+306
+307
+307
+307
+307
+308
+308
+309
+309
+309
+309
+310
+310
+311
+311
+311
+311
+311
+311
+315
+315
+316
+316
+316
+316
+316
+316
+317
+317
+317
+317
+318
+318
+318
+318
+318
+318
+321
+321
+321
+321
+322
+322
+322
+322
+323
+323
+325
+325
+325
+325
+327
+327
+327
+327
+327
+327
+33
+33
+331
+331
+331
+331
+332
+332
+333
+333
+333
+333
+335
+335
+336
+336
+338
+338
+339
+339
+34
+34
+341
+341
+342
+342
+342
+342
+344
+344
+344
+344
+345
+345
+348
+348
+348
+348
+348
+348
+348
+348
+348
+348
+35
+35
+35
+35
+35
+35
+351
+351
+353
+353
+353
+353
+356
+356
+360
+360
+362
+362
+364
+364
+365
+365
+366
+366
+367
+367
+367
+367
+368
+368
+369
+369
+369
+369
+369
+369
+37
+37
+37
+37
+373
+373
+374
+374
+375
+375
+377
+377
+378
+378
+379
+379
+382
+382
+382
+382
+384
+384
+384
+384
+384
+384
+386
+386
+389
+389
+392
+392
+393
+393
+394
+394
+395
+395
+395
+395
+396
+396
+396
+396
+396
+396
+397
+397
+397
+397
+399
+399
+399
+399
+4
+4
+400
+400
+401
+401
+401
+401
+401
+401
+401
+401
+401
+401
+402
+402
+403
+403
+403
+403
+403
+403
+404
+404
+404
+404
+406
+406
+406
+406
+406
+406
+406
+406
+407
+407
+409
+409
+409
+409
+409
+409
+41
+41
+411
+411
+413
+413
+413
+413
+414
+414
+414
+414
+417
+417
+417
+417
+417
+417
+418
+418
+419
+419
+42
+42
+42
+42
+421
+421
+424
+424
+424
+424
+427
+427
+429
+429
+429
+429
+43
+43
+430
+430
+430
+430
+430
+430
+431
+431
+431
+431
+431
+431
+432
+432
+435
+435
+436
+436
+437
+437
+438
+438
+438
+438
+438
+438
+439
+439
+439
+439
+44
+44
+443
+443
+444
+444
+446
+446
+448
+448
+449
+449
+452
+452
+453
+453
+454
+454
+454
+454
+454
+454
+455
+455
+457
+457
+458
+458
+458
+458
+459
+459
+459
+459
+460
+460
+462
+462
+462
+462
+463
+463
+463
+463
+466
+466
+466
+466
+466
+466
+467
+467
+468
+468
+468
+468
+468
+468
+468
+468
+469
+469
+469
+469
+469
+469
+469
+469
+469
+469
+47
+47
+470
+470
+472
+472
+475
+475
+477
+477
+478
+478
+478
+478
+479
+479
+480
+480
+480
+480
+480
+480
+481
+481
+482
+482
+483
+483
+484
+484
+485
+485
+487
+487
+489
+489
+489
+489
+489
+489
+489
+489
+490
+490
+491
+491
+492
+492
+492
+492
+493
+493
+494
+494
+495
+495
+496
+496
+497
+497
+498
+498
+498
+498
+498
+498
+5
+5
+5
+5
+5
+5
+51
+51
+51
+51
+53
+53
+54
+54
+57
+57
+58
+58
+58
+58
+64
+64
+65
+65
+66
+66
+67
+67
+67
+67
+69
+69
+70
+70
+70
+70
+70
+70
+72
+72
+72
+72
+74
+74
+76
+76
+76
+76
+77
+77
+78
+78
+8
+8
+80
+80
+82
+82
+83
+83
+83
+83
+84
+84
+84
+84
+85
+85
+86
+86
+87
+87
+9
+9
+90
+90
+90
+90
+90
+90
+92
+92
+95
+95
+95
+95
+96
+96
+97
+97
+97
+97
+98
+98
+98
+98