PREHOOK: query: -- see HIVE-2382 create table invites (id int, foo int, bar int) PREHOOK: type: CREATETABLE POSTHOOK: query: -- see HIVE-2382 create table invites (id int, foo int, bar int) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@invites PREHOOK: query: explain select * from (select foo, bar from (select bar, foo from invites c union all select bar, foo from invites d) b) a group by bar, foo having bar=1 PREHOOK: type: QUERY POSTHOOK: query: explain select * from (select foo, bar from (select bar, foo from invites c union all select bar, foo from invites d) b) a group by bar, foo having bar=1 POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_UNION (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME invites) c)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL bar)) (TOK_SELEXPR (TOK_TABLE_OR_COL foo))))) (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME invites) d)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL bar)) (TOK_SELEXPR (TOK_TABLE_OR_COL foo)))))) b)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL foo)) (TOK_SELEXPR (TOK_TABLE_OR_COL bar))))) a)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_GROUPBY (TOK_TABLE_OR_COL bar) (TOK_TABLE_OR_COL foo)) (TOK_HAVING (= (TOK_TABLE_OR_COL bar) 1)))) STAGE DEPENDENCIES: Stage-1 is a root stage Stage-0 is a root stage STAGE PLANS: Stage: Stage-1 Map Reduce Alias -> Map Operator Tree: a-subquery1:b-subquery1:c TableScan alias: c Filter Operator predicate: expr: (bar = 1) type: boolean Select Operator expressions: expr: bar type: int expr: foo type: int outputColumnNames: _col0, _col1 Union Select Operator expressions: expr: _col1 type: int expr: _col0 type: int outputColumnNames: _col0, _col1 Group By Operator bucketGroup: false keys: expr: _col1 type: int expr: _col0 type: int mode: hash outputColumnNames: _col0, _col1 Reduce Output Operator key expressions: expr: _col0 type: int expr: _col1 type: int sort order: ++ Map-reduce partition columns: expr: _col0 type: int expr: _col1 type: int tag: -1 a-subquery2:b-subquery2:d TableScan alias: d Filter Operator predicate: expr: (bar = 1) type: boolean Select Operator expressions: expr: bar type: int expr: foo type: int outputColumnNames: _col0, _col1 Union Select Operator expressions: expr: _col1 type: int expr: _col0 type: int outputColumnNames: _col0, _col1 Group By Operator bucketGroup: false keys: expr: _col1 type: int expr: _col0 type: int mode: hash outputColumnNames: _col0, _col1 Reduce Output Operator key expressions: expr: _col0 type: int expr: _col1 type: int sort order: ++ Map-reduce partition columns: expr: _col0 type: int expr: _col1 type: int tag: -1 Reduce Operator Tree: Group By Operator bucketGroup: false keys: expr: KEY._col0 type: int expr: KEY._col1 type: int mode: mergepartial outputColumnNames: _col0, _col1 Select Operator expressions: expr: _col0 type: int expr: _col1 type: int outputColumnNames: _col0, _col1 File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat Stage: Stage-0 Fetch Operator limit: -1 PREHOOK: query: drop table invites PREHOOK: type: DROPTABLE PREHOOK: Input: default@invites PREHOOK: Output: default@invites POSTHOOK: query: drop table invites POSTHOOK: type: DROPTABLE POSTHOOK: Input: default@invites POSTHOOK: Output: default@invites