http://git-wip-us.apache.org/repos/asf/hive/blob/1f258e96/ql/src/test/results/clientpositive/llap/udaf_collect_set_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/udaf_collect_set_2.q.out 
b/ql/src/test/results/clientpositive/llap/udaf_collect_set_2.q.out
new file mode 100644
index 0000000..7425988
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/udaf_collect_set_2.q.out
@@ -0,0 +1,742 @@
+PREHOOK: query: DESCRIBE FUNCTION collect_set
+PREHOOK: type: DESCFUNCTION
+POSTHOOK: query: DESCRIBE FUNCTION collect_set
+POSTHOOK: type: DESCFUNCTION
+collect_set(x) - Returns a set of objects with duplicate elements eliminated
+PREHOOK: query: DESCRIBE FUNCTION EXTENDED collect_set
+PREHOOK: type: DESCFUNCTION
+POSTHOOK: query: DESCRIBE FUNCTION EXTENDED collect_set
+POSTHOOK: type: DESCFUNCTION
+collect_set(x) - Returns a set of objects with duplicate elements eliminated
+PREHOOK: query: DESCRIBE FUNCTION collect_list
+PREHOOK: type: DESCFUNCTION
+POSTHOOK: query: DESCRIBE FUNCTION collect_list
+POSTHOOK: type: DESCFUNCTION
+collect_list(x) - Returns a list of objects with duplicates
+PREHOOK: query: DESCRIBE FUNCTION EXTENDED collect_list
+PREHOOK: type: DESCFUNCTION
+POSTHOOK: query: DESCRIBE FUNCTION EXTENDED collect_list
+POSTHOOK: type: DESCFUNCTION
+collect_list(x) - Returns a list of objects with duplicates
+PREHOOK: query: -- initialize tables
+
+CREATE TABLE customers (id int, name varchar(10), age int)
+ROW FORMAT DELIMITED
+FIELDS TERMINATED BY ','
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@customers
+POSTHOOK: query: -- initialize tables
+
+CREATE TABLE customers (id int, name varchar(10), age int)
+ROW FORMAT DELIMITED
+FIELDS TERMINATED BY ','
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@customers
+PREHOOK: query: LOAD DATA LOCAL INPATH "../../data/files/customers.txt" INTO 
TABLE customers
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@customers
+POSTHOOK: query: LOAD DATA LOCAL INPATH "../../data/files/customers.txt" INTO 
TABLE customers
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@customers
+PREHOOK: query: CREATE TABLE orders (id int, cid int, date date, amount double)
+ROW FORMAT DELIMITED
+FIELDS TERMINATED BY ','
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@orders
+POSTHOOK: query: CREATE TABLE orders (id int, cid int, date date, amount 
double)
+ROW FORMAT DELIMITED
+FIELDS TERMINATED BY ','
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@orders
+PREHOOK: query: LOAD DATA LOCAL INPATH "../../data/files/orders.txt" INTO 
TABLE orders
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@orders
+POSTHOOK: query: LOAD DATA LOCAL INPATH "../../data/files/orders.txt" INTO 
TABLE orders
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@orders
+PREHOOK: query: CREATE TABLE nested_orders (id int, cid int, date date, sub 
map<string,double>)
+ROW FORMAT DELIMITED
+FIELDS TERMINATED BY ','
+COLLECTION ITEMS TERMINATED BY '$'
+MAP KEYS TERMINATED BY ':'
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@nested_orders
+POSTHOOK: query: CREATE TABLE nested_orders (id int, cid int, date date, sub 
map<string,double>)
+ROW FORMAT DELIMITED
+FIELDS TERMINATED BY ','
+COLLECTION ITEMS TERMINATED BY '$'
+MAP KEYS TERMINATED BY ':'
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@nested_orders
+PREHOOK: query: LOAD DATA LOCAL INPATH "../../data/files/nested_orders.txt" 
INTO TABLE nested_orders
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@nested_orders
+POSTHOOK: query: LOAD DATA LOCAL INPATH "../../data/files/nested_orders.txt" 
INTO TABLE nested_orders
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@nested_orders
+PREHOOK: query: -- 1. test struct
+
+-- 1.1 when field is primitive
+
+SELECT c.id, sort_array(collect_set(named_struct("name", c.name, "date", 
o.date, "amount", o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: -- 1. test struct
+
+-- 1.1 when field is primitive
+
+SELECT c.id, sort_array(collect_set(named_struct("name", c.name, "date", 
o.date, "amount", o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      
[{"name":"Chris","date":"2013-06-21","amount":21.45},{"name":"Chris","date":"2014-10-11","amount":29.36}]
+2      
[{"name":"John","date":"2013-08-10","amount":126.57},{"name":"John","date":"2014-06-25","amount":3.65},{"name":"John","date":"2015-01-15","amount":27.45}]
+3      
[{"name":"Martin","date":"2014-05-11","amount":30.5},{"name":"Martin","date":"2014-12-12","amount":210.03}]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(named_struct("name", 
c.name, "date", o.date, "amount", o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(named_struct("name", 
c.name, "date", o.date, "amount", o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      
[{"name":"Chris","date":"2013-06-21","amount":21.45},{"name":"Chris","date":"2013-06-21","amount":21.45},{"name":"Chris","date":"2014-10-11","amount":29.36}]
+2      
[{"name":"John","date":"2013-08-10","amount":126.57},{"name":"John","date":"2014-06-25","amount":3.65},{"name":"John","date":"2015-01-15","amount":27.45}]
+3      
[{"name":"Martin","date":"2014-05-11","amount":30.5},{"name":"Martin","date":"2014-12-12","amount":210.03}]
+PREHOOK: query: -- cast decimal
+
+SELECT c.id, sort_array(collect_set(named_struct("name", c.name, "date", 
o.date, "amount", cast(o.amount as decimal(10,1)))))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: -- cast decimal
+
+SELECT c.id, sort_array(collect_set(named_struct("name", c.name, "date", 
o.date, "amount", cast(o.amount as decimal(10,1)))))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      
[{"name":"Chris","date":"2013-06-21","amount":21.5},{"name":"Chris","date":"2014-10-11","amount":29.4}]
+2      
[{"name":"John","date":"2013-08-10","amount":126.6},{"name":"John","date":"2014-06-25","amount":3.7},{"name":"John","date":"2015-01-15","amount":27.5}]
+3      
[{"name":"Martin","date":"2014-05-11","amount":30.5},{"name":"Martin","date":"2014-12-12","amount":210}]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(named_struct("name", 
c.name, "date", o.date, "amount", cast(o.amount as decimal(10,1)))))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(named_struct("name", 
c.name, "date", o.date, "amount", cast(o.amount as decimal(10,1)))))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      
[{"name":"Chris","date":"2013-06-21","amount":21.5},{"name":"Chris","date":"2013-06-21","amount":21.5},{"name":"Chris","date":"2014-10-11","amount":29.4}]
+2      
[{"name":"John","date":"2013-08-10","amount":126.6},{"name":"John","date":"2014-06-25","amount":3.7},{"name":"John","date":"2015-01-15","amount":27.5}]
+3      
[{"name":"Martin","date":"2014-05-11","amount":30.5},{"name":"Martin","date":"2014-12-12","amount":210}]
+PREHOOK: query: SELECT c.id, sort_array(collect_set(struct(c.name, o.date, 
o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_set(struct(c.name, o.date, 
o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      
[{"col1":"Chris","col2":"2013-06-21","col3":21.45},{"col1":"Chris","col2":"2014-10-11","col3":29.36}]
+2      
[{"col1":"John","col2":"2013-08-10","col3":126.57},{"col1":"John","col2":"2014-06-25","col3":3.65},{"col1":"John","col2":"2015-01-15","col3":27.45}]
+3      
[{"col1":"Martin","col2":"2014-05-11","col3":30.5},{"col1":"Martin","col2":"2014-12-12","col3":210.03}]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(struct(c.name, o.date, 
o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(struct(c.name, o.date, 
o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      
[{"col1":"Chris","col2":"2013-06-21","col3":21.45},{"col1":"Chris","col2":"2013-06-21","col3":21.45},{"col1":"Chris","col2":"2014-10-11","col3":29.36}]
+2      
[{"col1":"John","col2":"2013-08-10","col3":126.57},{"col1":"John","col2":"2014-06-25","col3":3.65},{"col1":"John","col2":"2015-01-15","col3":27.45}]
+3      
[{"col1":"Martin","col2":"2014-05-11","col3":30.5},{"col1":"Martin","col2":"2014-12-12","col3":210.03}]
+PREHOOK: query: -- 1.2 when field is map
+
+SELECT c.id, sort_array(collect_set(named_struct("name", c.name, "date", 
o.date, "sub", o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: -- 1.2 when field is map
+
+SELECT c.id, sort_array(collect_set(named_struct("name", c.name, "date", 
o.date, "sub", o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      
[{"name":"Chris","date":"2013-06-21","sub":{"\"juice\"":21.45,"\"bread\"":15.2}},{"name":"Chris","date":"2014-10-11","sub":{"\"grape\"":1200.5,"\"rice\"":29.36}}]
+2      
[{"name":"John","date":"2013-08-10","sub":{"\"yogurt\"":126.57,"\"beef\"":210.57}},{"name":"John","date":"2014-06-25","sub":{"\"chocolate\"":3.65,"\"water\"":420.36}},{"name":"John","date":"2015-01-15","sub":{"\"milk\"":27.45}}]
+3      
[{"name":"Martin","date":"2014-05-11","sub":{"\"apple\"":30.5,"\"orange\"":41.35}},{"name":"Martin","date":"2014-12-12","sub":{"\"icecream\"":210.03,"\"banana\"":100.56,"\"coffee":500.0}}]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(named_struct("name", 
c.name, "date", o.date, "sub", o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(named_struct("name", 
c.name, "date", o.date, "sub", o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      
[{"name":"Chris","date":"2013-06-21","sub":{"\"juice\"":21.45,"\"bread\"":15.2}},{"name":"Chris","date":"2013-06-21","sub":{"\"juice\"":21.45,"\"bread\"":15.2}},{"name":"Chris","date":"2014-10-11","sub":{"\"grape\"":1200.5,"\"rice\"":29.36}}]
+2      
[{"name":"John","date":"2013-08-10","sub":{"\"yogurt\"":126.57,"\"beef\"":210.57}},{"name":"John","date":"2014-06-25","sub":{"\"chocolate\"":3.65,"\"water\"":420.36}},{"name":"John","date":"2015-01-15","sub":{"\"milk\"":27.45}}]
+3      
[{"name":"Martin","date":"2014-05-11","sub":{"\"apple\"":30.5,"\"orange\"":41.35}},{"name":"Martin","date":"2014-12-12","sub":{"\"icecream\"":210.03,"\"banana\"":100.56,"\"coffee":500.0}}]
+PREHOOK: query: SELECT c.id, sort_array(collect_set(struct(c.name, o.date, 
o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_set(struct(c.name, o.date, 
o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      
[{"col1":"Chris","col2":"2013-06-21","col3":{"\"juice\"":21.45,"\"bread\"":15.2}},{"col1":"Chris","col2":"2014-10-11","col3":{"\"grape\"":1200.5,"\"rice\"":29.36}}]
+2      
[{"col1":"John","col2":"2013-08-10","col3":{"\"yogurt\"":126.57,"\"beef\"":210.57}},{"col1":"John","col2":"2014-06-25","col3":{"\"chocolate\"":3.65,"\"water\"":420.36}},{"col1":"John","col2":"2015-01-15","col3":{"\"milk\"":27.45}}]
+3      
[{"col1":"Martin","col2":"2014-05-11","col3":{"\"apple\"":30.5,"\"orange\"":41.35}},{"col1":"Martin","col2":"2014-12-12","col3":{"\"icecream\"":210.03,"\"banana\"":100.56,"\"coffee":500.0}}]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(struct(c.name, o.date, 
o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(struct(c.name, o.date, 
o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      
[{"col1":"Chris","col2":"2013-06-21","col3":{"\"juice\"":21.45,"\"bread\"":15.2}},{"col1":"Chris","col2":"2013-06-21","col3":{"\"juice\"":21.45,"\"bread\"":15.2}},{"col1":"Chris","col2":"2014-10-11","col3":{"\"grape\"":1200.5,"\"rice\"":29.36}}]
+2      
[{"col1":"John","col2":"2013-08-10","col3":{"\"yogurt\"":126.57,"\"beef\"":210.57}},{"col1":"John","col2":"2014-06-25","col3":{"\"chocolate\"":3.65,"\"water\"":420.36}},{"col1":"John","col2":"2015-01-15","col3":{"\"milk\"":27.45}}]
+3      
[{"col1":"Martin","col2":"2014-05-11","col3":{"\"apple\"":30.5,"\"orange\"":41.35}},{"col1":"Martin","col2":"2014-12-12","col3":{"\"icecream\"":210.03,"\"banana\"":100.56,"\"coffee":500.0}}]
+PREHOOK: query: -- 1.3 when field is list
+
+SELECT c.id, sort_array(collect_set(named_struct("name", c.name, "date", 
o.date, "sub", map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: -- 1.3 when field is list
+
+SELECT c.id, sort_array(collect_set(named_struct("name", c.name, "date", 
o.date, "sub", map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      
[{"name":"Chris","date":"2013-06-21","sub":[21.45,15.2]},{"name":"Chris","date":"2014-10-11","sub":[1200.5,29.36]}]
+2      
[{"name":"John","date":"2013-08-10","sub":[126.57,210.57]},{"name":"John","date":"2014-06-25","sub":[3.65,420.36]},{"name":"John","date":"2015-01-15","sub":[27.45]}]
+3      
[{"name":"Martin","date":"2014-05-11","sub":[30.5,41.35]},{"name":"Martin","date":"2014-12-12","sub":[210.03,100.56,500.0]}]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(named_struct("name", 
c.name, "date", o.date, "sub", map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(named_struct("name", 
c.name, "date", o.date, "sub", map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      
[{"name":"Chris","date":"2013-06-21","sub":[21.45,15.2]},{"name":"Chris","date":"2013-06-21","sub":[21.45,15.2]},{"name":"Chris","date":"2014-10-11","sub":[1200.5,29.36]}]
+2      
[{"name":"John","date":"2013-08-10","sub":[126.57,210.57]},{"name":"John","date":"2014-06-25","sub":[3.65,420.36]},{"name":"John","date":"2015-01-15","sub":[27.45]}]
+3      
[{"name":"Martin","date":"2014-05-11","sub":[30.5,41.35]},{"name":"Martin","date":"2014-12-12","sub":[210.03,100.56,500.0]}]
+PREHOOK: query: SELECT c.id, sort_array(collect_set(struct(c.name, o.date, 
map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_set(struct(c.name, o.date, 
map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      
[{"col1":"Chris","col2":"2013-06-21","col3":[21.45,15.2]},{"col1":"Chris","col2":"2014-10-11","col3":[1200.5,29.36]}]
+2      
[{"col1":"John","col2":"2013-08-10","col3":[126.57,210.57]},{"col1":"John","col2":"2014-06-25","col3":[3.65,420.36]},{"col1":"John","col2":"2015-01-15","col3":[27.45]}]
+3      
[{"col1":"Martin","col2":"2014-05-11","col3":[30.5,41.35]},{"col1":"Martin","col2":"2014-12-12","col3":[210.03,100.56,500.0]}]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(struct(c.name, o.date, 
map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(struct(c.name, o.date, 
map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      
[{"col1":"Chris","col2":"2013-06-21","col3":[21.45,15.2]},{"col1":"Chris","col2":"2013-06-21","col3":[21.45,15.2]},{"col1":"Chris","col2":"2014-10-11","col3":[1200.5,29.36]}]
+2      
[{"col1":"John","col2":"2013-08-10","col3":[126.57,210.57]},{"col1":"John","col2":"2014-06-25","col3":[3.65,420.36]},{"col1":"John","col2":"2015-01-15","col3":[27.45]}]
+3      
[{"col1":"Martin","col2":"2014-05-11","col3":[30.5,41.35]},{"col1":"Martin","col2":"2014-12-12","col3":[210.03,100.56,500.0]}]
+PREHOOK: query: -- 2. test array
+
+-- 2.1 when field is primitive
+
+SELECT c.id, sort_array(collect_set(array(o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: -- 2. test array
+
+-- 2.1 when field is primitive
+
+SELECT c.id, sort_array(collect_set(array(o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      [[21.45],[29.36]]
+2      [[3.65],[27.45],[126.57]]
+3      [[30.5],[210.03]]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(array(o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(array(o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      [[21.45],[21.45],[29.36]]
+2      [[3.65],[27.45],[126.57]]
+3      [[30.5],[210.03]]
+PREHOOK: query: -- cast decimal
+
+SELECT c.id, sort_array(collect_set(array(cast(o.amount as decimal(10,1)))))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: -- cast decimal
+
+SELECT c.id, sort_array(collect_set(array(cast(o.amount as decimal(10,1)))))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      [[21.5],[29.4]]
+2      [[3.7],[27.5],[126.6]]
+3      [[30.5],[210]]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(array(cast(o.amount as 
decimal(10,1)))))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(array(cast(o.amount as 
decimal(10,1)))))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      [[21.5],[21.5],[29.4]]
+2      [[3.7],[27.5],[126.6]]
+3      [[30.5],[210]]
+PREHOOK: query: -- 2.2 when field is struct
+
+SELECT c.id, sort_array(collect_set(array(o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: -- 2.2 when field is struct
+
+SELECT c.id, sort_array(collect_set(array(o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      
[[{"\"juice\"":21.45,"\"bread\"":15.2}],[{"\"grape\"":1200.5,"\"rice\"":29.36}]]
+2      
[[{"\"milk\"":27.45}],[{"\"yogurt\"":126.57,"\"beef\"":210.57}],[{"\"chocolate\"":3.65,"\"water\"":420.36}]]
+3      
[[{"\"apple\"":30.5,"\"orange\"":41.35}],[{"\"icecream\"":210.03,"\"banana\"":100.56,"\"coffee":500.0}]]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(array(o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(array(o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      
[[{"\"juice\"":21.45,"\"bread\"":15.2}],[{"\"juice\"":21.45,"\"bread\"":15.2}],[{"\"grape\"":1200.5,"\"rice\"":29.36}]]
+2      
[[{"\"milk\"":27.45}],[{"\"yogurt\"":126.57,"\"beef\"":210.57}],[{"\"chocolate\"":3.65,"\"water\"":420.36}]]
+3      
[[{"\"apple\"":30.5,"\"orange\"":41.35}],[{"\"icecream\"":210.03,"\"banana\"":100.56,"\"coffee":500.0}]]
+PREHOOK: query: -- 2.3 when field is list
+
+SELECT c.id, sort_array(collect_set(array(map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: -- 2.3 when field is list
+
+SELECT c.id, sort_array(collect_set(array(map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      [[[21.45,15.2]],[[1200.5,29.36]]]
+2      [[[3.65,420.36]],[[27.45]],[[126.57,210.57]]]
+3      [[[30.5,41.35]],[[210.03,100.56,500.0]]]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(array(map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, 
sort_array(collect_list(array(map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      [[[21.45,15.2]],[[21.45,15.2]],[[1200.5,29.36]]]
+2      [[[3.65,420.36]],[[27.45]],[[126.57,210.57]]]
+3      [[[30.5,41.35]],[[210.03,100.56,500.0]]]
+PREHOOK: query: -- 3. test map
+
+-- 3.1 when field is primitive
+
+SELECT c.id, sort_array(collect_set(map("amount", o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: -- 3. test map
+
+-- 3.1 when field is primitive
+
+SELECT c.id, sort_array(collect_set(map("amount", o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      [{"amount":21.45},{"amount":29.36}]
+2      [{"amount":3.65},{"amount":27.45},{"amount":126.57}]
+3      [{"amount":30.5},{"amount":210.03}]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(map("amount", o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(map("amount", o.amount)))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      [{"amount":21.45},{"amount":21.45},{"amount":29.36}]
+2      [{"amount":3.65},{"amount":27.45},{"amount":126.57}]
+3      [{"amount":30.5},{"amount":210.03}]
+PREHOOK: query: -- cast decimal
+
+SELECT c.id, sort_array(collect_set(map("amount", cast(o.amount as 
decimal(10,1)))))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: -- cast decimal
+
+SELECT c.id, sort_array(collect_set(map("amount", cast(o.amount as 
decimal(10,1)))))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      [{"amount":21.5},{"amount":29.4}]
+2      [{"amount":3.7},{"amount":27.5},{"amount":126.6}]
+3      [{"amount":30.5},{"amount":210}]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(map("amount", 
cast(o.amount as decimal(10,1)))))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(map("amount", 
cast(o.amount as decimal(10,1)))))
+FROM customers c
+INNER JOIN orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@orders
+#### A masked pattern was here ####
+1      [{"amount":21.5},{"amount":21.5},{"amount":29.4}]
+2      [{"amount":3.7},{"amount":27.5},{"amount":126.6}]
+3      [{"amount":30.5},{"amount":210}]
+PREHOOK: query: -- 3.2 when field is struct
+
+SELECT c.id, sort_array(collect_set(map("sub", o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: -- 3.2 when field is struct
+
+SELECT c.id, sort_array(collect_set(map("sub", o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      
[{"sub":{"\"juice\"":21.45,"\"bread\"":15.2}},{"sub":{"\"grape\"":1200.5,"\"rice\"":29.36}}]
+2      
[{"sub":{"\"milk\"":27.45}},{"sub":{"\"yogurt\"":126.57,"\"beef\"":210.57}},{"sub":{"\"chocolate\"":3.65,"\"water\"":420.36}}]
+3      
[{"sub":{"\"apple\"":30.5,"\"orange\"":41.35}},{"sub":{"\"icecream\"":210.03,"\"banana\"":100.56,"\"coffee":500.0}}]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(map("sub", o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(map("sub", o.sub)))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      
[{"sub":{"\"juice\"":21.45,"\"bread\"":15.2}},{"sub":{"\"juice\"":21.45,"\"bread\"":15.2}},{"sub":{"\"grape\"":1200.5,"\"rice\"":29.36}}]
+2      
[{"sub":{"\"milk\"":27.45}},{"sub":{"\"yogurt\"":126.57,"\"beef\"":210.57}},{"sub":{"\"chocolate\"":3.65,"\"water\"":420.36}}]
+3      
[{"sub":{"\"apple\"":30.5,"\"orange\"":41.35}},{"sub":{"\"icecream\"":210.03,"\"banana\"":100.56,"\"coffee":500.0}}]
+PREHOOK: query: -- 3.3 when field is list
+
+SELECT c.id, sort_array(collect_set(map("sub", map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: -- 3.3 when field is list
+
+SELECT c.id, sort_array(collect_set(map("sub", map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      [{"sub":[21.45,15.2]},{"sub":[1200.5,29.36]}]
+2      [{"sub":[3.65,420.36]},{"sub":[27.45]},{"sub":[126.57,210.57]}]
+3      [{"sub":[30.5,41.35]},{"sub":[210.03,100.56,500.0]}]
+PREHOOK: query: SELECT c.id, sort_array(collect_list(map("sub", 
map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+PREHOOK: type: QUERY
+PREHOOK: Input: default@customers
+PREHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT c.id, sort_array(collect_list(map("sub", 
map_values(o.sub))))
+FROM customers c
+INNER JOIN nested_orders o
+ON (c.id = o.cid) GROUP BY c.id
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@customers
+POSTHOOK: Input: default@nested_orders
+#### A masked pattern was here ####
+1      [{"sub":[21.45,15.2]},{"sub":[21.45,15.2]},{"sub":[1200.5,29.36]}]
+2      [{"sub":[3.65,420.36]},{"sub":[27.45]},{"sub":[126.57,210.57]}]
+3      [{"sub":[30.5,41.35]},{"sub":[210.03,100.56,500.0]}]
+PREHOOK: query: -- clean up
+
+DROP TABLE customer
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: -- clean up
+
+DROP TABLE customer
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: DROP TABLE orders
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@orders
+PREHOOK: Output: default@orders
+POSTHOOK: query: DROP TABLE orders
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@orders
+POSTHOOK: Output: default@orders
+PREHOOK: query: DROP TABLE nested_orders
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@nested_orders
+PREHOOK: Output: default@nested_orders
+POSTHOOK: query: DROP TABLE nested_orders
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@nested_orders
+POSTHOOK: Output: default@nested_orders

http://git-wip-us.apache.org/repos/asf/hive/blob/1f258e96/ql/src/test/results/clientpositive/llap/union_remove_26.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/union_remove_26.q.out 
b/ql/src/test/results/clientpositive/llap/union_remove_26.q.out
new file mode 100644
index 0000000..797b947
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/union_remove_26.q.out
@@ -0,0 +1,849 @@
+PREHOOK: query: -- This is to test the union remove optimization with stats 
optimization
+
+create table inputSrcTbl1(key string, val int) stored as textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@inputSrcTbl1
+POSTHOOK: query: -- This is to test the union remove optimization with stats 
optimization
+
+create table inputSrcTbl1(key string, val int) stored as textfile
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@inputSrcTbl1
+PREHOOK: query: create table inputSrcTbl2(key string, val int) stored as 
textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@inputSrcTbl2
+POSTHOOK: query: create table inputSrcTbl2(key string, val int) stored as 
textfile
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@inputSrcTbl2
+PREHOOK: query: create table inputSrcTbl3(key string, val int) stored as 
textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@inputSrcTbl3
+POSTHOOK: query: create table inputSrcTbl3(key string, val int) stored as 
textfile
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@inputSrcTbl3
+PREHOOK: query: load data local inpath '../../data/files/T1.txt' into table 
inputSrcTbl1
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@inputsrctbl1
+POSTHOOK: query: load data local inpath '../../data/files/T1.txt' into table 
inputSrcTbl1
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@inputsrctbl1
+PREHOOK: query: load data local inpath '../../data/files/T2.txt' into table 
inputSrcTbl2
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@inputsrctbl2
+POSTHOOK: query: load data local inpath '../../data/files/T2.txt' into table 
inputSrcTbl2
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@inputsrctbl2
+PREHOOK: query: load data local inpath '../../data/files/T3.txt' into table 
inputSrcTbl3
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@inputsrctbl3
+POSTHOOK: query: load data local inpath '../../data/files/T3.txt' into table 
inputSrcTbl3
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@inputsrctbl3
+PREHOOK: query: create table inputTbl1(key string, val int) stored as textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@inputTbl1
+POSTHOOK: query: create table inputTbl1(key string, val int) stored as textfile
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@inputTbl1
+PREHOOK: query: create table inputTbl2(key string, val int) stored as textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@inputTbl2
+POSTHOOK: query: create table inputTbl2(key string, val int) stored as textfile
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@inputTbl2
+PREHOOK: query: create table inputTbl3(key string, val int) stored as textfile
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@inputTbl3
+POSTHOOK: query: create table inputTbl3(key string, val int) stored as textfile
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@inputTbl3
+PREHOOK: query: insert into inputTbl1 select * from inputSrcTbl1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inputsrctbl1
+PREHOOK: Output: default@inputtbl1
+POSTHOOK: query: insert into inputTbl1 select * from inputSrcTbl1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inputsrctbl1
+POSTHOOK: Output: default@inputtbl1
+POSTHOOK: Lineage: inputtbl1.key SIMPLE 
[(inputsrctbl1)inputsrctbl1.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: inputtbl1.val SIMPLE 
[(inputsrctbl1)inputsrctbl1.FieldSchema(name:val, type:int, comment:null), ]
+PREHOOK: query: insert into inputTbl2 select * from inputSrcTbl2
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inputsrctbl2
+PREHOOK: Output: default@inputtbl2
+POSTHOOK: query: insert into inputTbl2 select * from inputSrcTbl2
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inputsrctbl2
+POSTHOOK: Output: default@inputtbl2
+POSTHOOK: Lineage: inputtbl2.key SIMPLE 
[(inputsrctbl2)inputsrctbl2.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: inputtbl2.val SIMPLE 
[(inputsrctbl2)inputsrctbl2.FieldSchema(name:val, type:int, comment:null), ]
+PREHOOK: query: insert into inputTbl3 select * from inputSrcTbl3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inputsrctbl3
+PREHOOK: Output: default@inputtbl3
+POSTHOOK: query: insert into inputTbl3 select * from inputSrcTbl3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inputsrctbl3
+POSTHOOK: Output: default@inputtbl3
+POSTHOOK: Lineage: inputtbl3.key SIMPLE 
[(inputsrctbl3)inputsrctbl3.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: inputtbl3.val SIMPLE 
[(inputsrctbl3)inputsrctbl3.FieldSchema(name:val, type:int, comment:null), ]
+PREHOOK: query: --- union remove optimization effects, stats optimization does 
not though it is on since inputTbl2 column stats is not available
+analyze table inputTbl1 compute statistics for columns
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inputtbl1
+#### A masked pattern was here ####
+POSTHOOK: query: --- union remove optimization effects, stats optimization 
does not though it is on since inputTbl2 column stats is not available
+analyze table inputTbl1 compute statistics for columns
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inputtbl1
+#### A masked pattern was here ####
+PREHOOK: query: analyze table inputTbl3 compute statistics for columns
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inputtbl3
+#### A masked pattern was here ####
+POSTHOOK: query: analyze table inputTbl3 compute statistics for columns
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inputtbl3
+#### A masked pattern was here ####
+PREHOOK: query: explain
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-2 is a root stage
+  Stage-1 depends on stages: Stage-2
+
+STAGE PLANS:
+  Stage: Stage-2
+    Tez
+#### A masked pattern was here ####
+      Edges:
+        Reducer 2 <- Map 1 (SIMPLE_EDGE)
+        Reducer 4 <- Map 3 (SIMPLE_EDGE)
+        Reducer 6 <- Map 5 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl1
+                  Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE 
Column stats: COMPLETE
+                  Select Operator
+                    expressions: val (type: int)
+                    outputColumnNames: _col1
+                    Statistics: Num rows: 6 Data size: 24 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      aggregations: count(1), min(_col1), max(_col1)
+                      mode: hash
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col0 (type: bigint), _col1 (type: 
int), _col2 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl2
+                  Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE 
Column stats: NONE
+                  Select Operator
+                    expressions: val (type: int)
+                    outputColumnNames: _col1
+                    Statistics: Num rows: 6 Data size: 24 Basic stats: 
COMPLETE Column stats: NONE
+                    Group By Operator
+                      aggregations: count(1), min(_col1), max(_col1)
+                      mode: hash
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: NONE
+                        value expressions: _col0 (type: bigint), _col1 (type: 
int), _col2 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl3
+                  Statistics: Num rows: 4 Data size: 16 Basic stats: COMPLETE 
Column stats: COMPLETE
+                  Select Operator
+                    expressions: val (type: int)
+                    outputColumnNames: _col1
+                    Statistics: Num rows: 4 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      aggregations: count(1), min(_col1), max(_col1)
+                      mode: hash
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col0 (type: bigint), _col1 (type: 
int), _col2 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Reducer 2 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0), min(VALUE._col1), 
max(VALUE._col2)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE 
Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 16 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
+        Reducer 4 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0), min(VALUE._col1), 
max(VALUE._col2)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE 
Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE 
Column stats: NONE
+                  table:
+                      input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                      output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Reducer 6 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0), min(VALUE._col1), 
max(VALUE._col2)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE 
Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 16 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-1
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select count(*) from (
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3) t
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inputtbl1
+PREHOOK: Input: default@inputtbl2
+PREHOOK: Input: default@inputtbl3
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from (
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3) t
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inputtbl1
+POSTHOOK: Input: default@inputtbl2
+POSTHOOK: Input: default@inputtbl3
+#### A masked pattern was here ####
+3
+PREHOOK: query: --- union remove optimization and stats optimization are 
effective after inputTbl2 column stats is calculated
+analyze table inputTbl2 compute statistics for columns
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inputtbl2
+#### A masked pattern was here ####
+POSTHOOK: query: --- union remove optimization and stats optimization are 
effective after inputTbl2 column stats is calculated
+analyze table inputTbl2 compute statistics for columns
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inputtbl2
+#### A masked pattern was here ####
+PREHOOK: query: explain
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 3
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select count(*) from (
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3) t
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inputtbl1
+PREHOOK: Input: default@inputtbl2
+PREHOOK: Input: default@inputtbl3
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from (
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3) t
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inputtbl1
+POSTHOOK: Input: default@inputtbl2
+POSTHOOK: Input: default@inputtbl3
+#### A masked pattern was here ####
+3
+PREHOOK: query: --- union remove optimization effects but stats optimization 
does not (with group by) though it is on
+explain
+  SELECT key, count(1) as rowcnt, min(val) as ms, max(val) as mx from 
inputTbl1 group by key
+  UNION ALL
+  SELECT key, count(1) as rowcnt, min(val) as ms, max(val) as mx from 
inputTbl2 group by key
+  UNION ALL
+  SELECT key, count(1) as rowcnt, min(val) as ms, max(val) as mx from 
inputTbl3 group by key
+PREHOOK: type: QUERY
+POSTHOOK: query: --- union remove optimization effects but stats optimization 
does not (with group by) though it is on
+explain
+  SELECT key, count(1) as rowcnt, min(val) as ms, max(val) as mx from 
inputTbl1 group by key
+  UNION ALL
+  SELECT key, count(1) as rowcnt, min(val) as ms, max(val) as mx from 
inputTbl2 group by key
+  UNION ALL
+  SELECT key, count(1) as rowcnt, min(val) as ms, max(val) as mx from 
inputTbl3 group by key
+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)
+        Reducer 4 <- Map 3 (SIMPLE_EDGE)
+        Reducer 6 <- Map 5 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl1
+                  Statistics: Num rows: 6 Data size: 534 Basic stats: COMPLETE 
Column stats: COMPLETE
+                  Select Operator
+                    expressions: key (type: string), val (type: int)
+                    outputColumnNames: _col0, _col2
+                    Statistics: Num rows: 6 Data size: 534 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      aggregations: count(1), min(_col2), max(_col2)
+                      keys: _col0 (type: string)
+                      mode: hash
+                      outputColumnNames: _col0, _col1, _col2, _col3
+                      Statistics: Num rows: 3 Data size: 303 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 3 Data size: 303 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col1 (type: bigint), _col2 (type: 
int), _col3 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl2
+                  Statistics: Num rows: 6 Data size: 534 Basic stats: COMPLETE 
Column stats: COMPLETE
+                  Select Operator
+                    expressions: key (type: string), val (type: int)
+                    outputColumnNames: _col0, _col2
+                    Statistics: Num rows: 6 Data size: 534 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      aggregations: count(1), min(_col2), max(_col2)
+                      keys: _col0 (type: string)
+                      mode: hash
+                      outputColumnNames: _col0, _col1, _col2, _col3
+                      Statistics: Num rows: 3 Data size: 303 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 3 Data size: 303 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col1 (type: bigint), _col2 (type: 
int), _col3 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl3
+                  Statistics: Num rows: 4 Data size: 356 Basic stats: COMPLETE 
Column stats: COMPLETE
+                  Select Operator
+                    expressions: key (type: string), val (type: int)
+                    outputColumnNames: _col0, _col2
+                    Statistics: Num rows: 4 Data size: 356 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      aggregations: count(1), min(_col2), max(_col2)
+                      keys: _col0 (type: string)
+                      mode: hash
+                      outputColumnNames: _col0, _col1, _col2, _col3
+                      Statistics: Num rows: 2 Data size: 202 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 2 Data size: 202 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col1 (type: bigint), _col2 (type: 
int), _col3 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Reducer 2 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0), min(VALUE._col1), 
max(VALUE._col2)
+                keys: KEY._col0 (type: string)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2, _col3
+                Statistics: Num rows: 3 Data size: 303 Basic stats: COMPLETE 
Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 3 Data size: 303 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
+        Reducer 4 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0), min(VALUE._col1), 
max(VALUE._col2)
+                keys: KEY._col0 (type: string)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2, _col3
+                Statistics: Num rows: 3 Data size: 303 Basic stats: COMPLETE 
Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 3 Data size: 303 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
+        Reducer 6 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0), min(VALUE._col1), 
max(VALUE._col2)
+                keys: KEY._col0 (type: string)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2, _col3
+                Statistics: Num rows: 2 Data size: 202 Basic stats: COMPLETE 
Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 2 Data size: 202 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 count(*) from (
+  SELECT key, count(1) as rowcnt, min(val) as ms, max(val) as mx from 
inputTbl1 group by key
+  UNION ALL
+  SELECT key, count(1) as rowcnt, min(val) as ms, max(val) as mx from 
inputTbl2 group by key
+  UNION ALL
+  SELECT key, count(1) as rowcnt, min(val) as ms, max(val) as mx from 
inputTbl3 group by key) t
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inputtbl1
+PREHOOK: Input: default@inputtbl2
+PREHOOK: Input: default@inputtbl3
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from (
+  SELECT key, count(1) as rowcnt, min(val) as ms, max(val) as mx from 
inputTbl1 group by key
+  UNION ALL
+  SELECT key, count(1) as rowcnt, min(val) as ms, max(val) as mx from 
inputTbl2 group by key
+  UNION ALL
+  SELECT key, count(1) as rowcnt, min(val) as ms, max(val) as mx from 
inputTbl3 group by key) t
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inputtbl1
+POSTHOOK: Input: default@inputtbl2
+POSTHOOK: Input: default@inputtbl3
+#### A masked pattern was here ####
+14
+PREHOOK: query: explain
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3
+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)
+        Reducer 4 <- Map 3 (SIMPLE_EDGE)
+        Reducer 6 <- Map 5 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl1
+                  Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE 
Column stats: COMPLETE
+                  Select Operator
+                    expressions: val (type: int)
+                    outputColumnNames: _col1
+                    Statistics: Num rows: 6 Data size: 24 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      aggregations: count(1), min(_col1), max(_col1)
+                      mode: hash
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col0 (type: bigint), _col1 (type: 
int), _col2 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl2
+                  Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE 
Column stats: COMPLETE
+                  Select Operator
+                    expressions: val (type: int)
+                    outputColumnNames: _col1
+                    Statistics: Num rows: 6 Data size: 24 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      aggregations: count(1), min(_col1), max(_col1)
+                      mode: hash
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col0 (type: bigint), _col1 (type: 
int), _col2 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl3
+                  Statistics: Num rows: 4 Data size: 16 Basic stats: COMPLETE 
Column stats: COMPLETE
+                  Select Operator
+                    expressions: val (type: int)
+                    outputColumnNames: _col1
+                    Statistics: Num rows: 4 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      aggregations: count(1), min(_col1), max(_col1)
+                      mode: hash
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col0 (type: bigint), _col1 (type: 
int), _col2 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Reducer 2 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0), min(VALUE._col1), 
max(VALUE._col2)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE 
Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 16 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
+        Reducer 4 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0), min(VALUE._col1), 
max(VALUE._col2)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE 
Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 16 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
+        Reducer 6 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0), min(VALUE._col1), 
max(VALUE._col2)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE 
Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1 Data size: 16 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 count(*) from (
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3) t
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inputtbl1
+PREHOOK: Input: default@inputtbl2
+PREHOOK: Input: default@inputtbl3
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from (
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3) t
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inputtbl1
+POSTHOOK: Input: default@inputtbl2
+POSTHOOK: Input: default@inputtbl3
+#### A masked pattern was here ####
+3
+PREHOOK: query: explain
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3
+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), Union 3 (CONTAINS)
+        Reducer 5 <- Map 4 (SIMPLE_EDGE), Union 3 (CONTAINS)
+        Reducer 7 <- Map 6 (SIMPLE_EDGE), Union 3 (CONTAINS)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl1
+                  Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE 
Column stats: COMPLETE
+                  Select Operator
+                    expressions: val (type: int)
+                    outputColumnNames: _col1
+                    Statistics: Num rows: 6 Data size: 24 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      aggregations: count(1), min(_col1), max(_col1)
+                      mode: hash
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col0 (type: bigint), _col1 (type: 
int), _col2 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl2
+                  Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE 
Column stats: COMPLETE
+                  Select Operator
+                    expressions: val (type: int)
+                    outputColumnNames: _col1
+                    Statistics: Num rows: 6 Data size: 24 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      aggregations: count(1), min(_col1), max(_col1)
+                      mode: hash
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col0 (type: bigint), _col1 (type: 
int), _col2 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Map 6 
+            Map Operator Tree:
+                TableScan
+                  alias: inputtbl3
+                  Statistics: Num rows: 4 Data size: 16 Basic stats: COMPLETE 
Column stats: COMPLETE
+                  Select Operator
+                    expressions: val (type: int)
+                    outputColumnNames: _col1
+                    Statistics: Num rows: 4 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Group By Operator
+                      aggregations: count(1), min(_col1), max(_col1)
+                      mode: hash
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Reduce Output Operator
+                        sort order: 
+                        Statistics: Num rows: 1 Data size: 16 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        value expressions: _col0 (type: bigint), _col1 (type: 
int), _col2 (type: int)
+            Execution mode: llap
+            LLAP IO: no inputs
+        Reducer 2 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0), min(VALUE._col1), 
max(VALUE._col2)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE 
Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 3 Data size: 48 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
+        Reducer 5 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0), min(VALUE._col1), 
max(VALUE._col2)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE 
Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 3 Data size: 48 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
+        Reducer 7 
+            Execution mode: llap
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0), min(VALUE._col1), 
max(VALUE._col2)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE 
Column stats: COMPLETE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 3 Data size: 48 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
+        Union 3 
+            Vertex: Union 3
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select count(*) from (
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3) t
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inputtbl1
+PREHOOK: Input: default@inputtbl2
+PREHOOK: Input: default@inputtbl3
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from (
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl1
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl2
+  UNION ALL
+  SELECT count(1) as rowcnt, min(val) as ms, max(val) as mx from inputTbl3) t
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inputtbl1
+POSTHOOK: Input: default@inputtbl2
+POSTHOOK: Input: default@inputtbl3
+#### A masked pattern was here ####
+3

Reply via email to