PREHOOK: query: drop table x PREHOOK: type: DROPTABLE POSTHOOK: query: drop table x POSTHOOK: type: DROPTABLE PREHOOK: query: drop table y PREHOOK: type: DROPTABLE POSTHOOK: query: drop table y POSTHOOK: type: DROPTABLE PREHOOK: query: drop table z PREHOOK: type: DROPTABLE POSTHOOK: query: drop table z POSTHOOK: type: DROPTABLE PREHOOK: query: CREATE TABLE x (name STRING, id INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' PREHOOK: type: CREATETABLE POSTHOOK: query: CREATE TABLE x (name STRING, id INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@x PREHOOK: query: CREATE TABLE y (id INT, name STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' PREHOOK: type: CREATETABLE POSTHOOK: query: CREATE TABLE y (id INT, name STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@y PREHOOK: query: CREATE TABLE z (id INT, name STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' PREHOOK: type: CREATETABLE POSTHOOK: query: CREATE TABLE z (id INT, name STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@z PREHOOK: query: load data local inpath '../data/files/x.txt' INTO TABLE x PREHOOK: type: LOAD PREHOOK: Output: default@x POSTHOOK: query: load data local inpath '../data/files/x.txt' INTO TABLE x POSTHOOK: type: LOAD POSTHOOK: Output: default@x PREHOOK: query: load data local inpath '../data/files/y.txt' INTO TABLE y PREHOOK: type: LOAD PREHOOK: Output: default@y POSTHOOK: query: load data local inpath '../data/files/y.txt' INTO TABLE y POSTHOOK: type: LOAD POSTHOOK: Output: default@y PREHOOK: query: load data local inpath '../data/files/z.txt' INTO TABLE z PREHOOK: type: LOAD PREHOOK: Output: default@z POSTHOOK: query: load data local inpath '../data/files/z.txt' INTO TABLE z POSTHOOK: type: LOAD POSTHOOK: Output: default@z PREHOOK: query: -- Since the inputs are small, it should be automatically converted to mapjoin EXPLAIN SELECT subq.key1, subq.value1, subq.key2, subq.value2, z.id, z.name FROM (SELECT x.id as key1, x.name as value1, y.id as key2, y.name as value2 FROM y JOIN x ON (x.id = y.id)) subq JOIN z ON (subq.key1 = z.id) PREHOOK: type: QUERY POSTHOOK: query: -- Since the inputs are small, it should be automatically converted to mapjoin EXPLAIN SELECT subq.key1, subq.value1, subq.key2, subq.value2, z.id, z.name FROM (SELECT x.id as key1, x.name as value1, y.id as key2, y.name as value2 FROM y JOIN x ON (x.id = y.id)) subq JOIN z ON (subq.key1 = z.id) POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME y)) (TOK_TABREF (TOK_TABNAME x)) (= (. (TOK_TABLE_OR_COL x) id) (. (TOK_TABLE_OR_COL y) id)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) id) key1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) name) value1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL y) id) key2) (TOK_SELEXPR (. (TOK_TABLE_OR_COL y) name) value2)))) subq) (TOK_TABREF (TOK_TABNAME z)) (= (. (TOK_TABLE_OR_COL subq) key1) (. (TOK_TABLE_OR_COL z) id)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq) key1)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq) value1)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq) key2)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq) value2)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL z) id)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL z) name))))) STAGE DEPENDENCIES: Stage-7 is a root stage Stage-5 depends on stages: Stage-7 Stage-0 is a root stage STAGE PLANS: Stage: Stage-7 Map Reduce Local Work Alias -> Map Local Tables: subq:y Fetch Operator limit: -1 z Fetch Operator limit: -1 Alias -> Map Local Operator Tree: subq:y TableScan alias: y HashTable Sink Operator condition expressions: 0 {id} {name} 1 {name} {id} handleSkewJoin: false keys: 0 [Column[id]] 1 [Column[id]] Position of Big Table: 1 z TableScan alias: z HashTable Sink Operator condition expressions: 0 {_col0} {_col1} {_col2} {_col3} 1 {id} {name} handleSkewJoin: false keys: 0 [Column[_col0]] 1 [Column[id]] Position of Big Table: 0 Stage: Stage-5 Map Reduce Alias -> Map Operator Tree: subq:x TableScan alias: x Map Join Operator condition map: Inner Join 0 to 1 condition expressions: 0 {id} {name} 1 {name} {id} handleSkewJoin: false keys: 0 [Column[id]] 1 [Column[id]] outputColumnNames: _col0, _col1, _col4, _col5 Position of Big Table: 1 Select Operator expressions: expr: _col5 type: int expr: _col4 type: string expr: _col0 type: int expr: _col1 type: string outputColumnNames: _col0, _col1, _col2, _col3 Map Join Operator condition map: Inner Join 0 to 1 condition expressions: 0 {_col0} {_col1} {_col2} {_col3} 1 {id} {name} handleSkewJoin: false keys: 0 [Column[_col0]] 1 [Column[id]] outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 Position of Big Table: 0 Select Operator expressions: expr: _col0 type: int expr: _col1 type: string expr: _col2 type: int expr: _col3 type: string expr: _col4 type: int expr: _col5 type: string outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat Local Work: Map Reduce Local Work Stage: Stage-0 Fetch Operator limit: -1 PREHOOK: query: SELECT subq.key1, subq.value1, subq.key2, subq.value2, z.id, z.name FROM (SELECT x.id as key1, x.name as value1, y.id as key2, y.name as value2 FROM y JOIN x ON (x.id = y.id)) subq JOIN z ON (subq.key1 = z.id) PREHOOK: type: QUERY PREHOOK: Input: default@x PREHOOK: Input: default@y PREHOOK: Input: default@z #### A masked pattern was here #### POSTHOOK: query: SELECT subq.key1, subq.value1, subq.key2, subq.value2, z.id, z.name FROM (SELECT x.id as key1, x.name as value1, y.id as key2, y.name as value2 FROM y JOIN x ON (x.id = y.id)) subq JOIN z ON (subq.key1 = z.id) POSTHOOK: type: QUERY POSTHOOK: Input: default@x POSTHOOK: Input: default@y POSTHOOK: Input: default@z #### A masked pattern was here #### 2 Joe 2 Tie 2 Tie 2 Hank 2 Tie 2 Tie PREHOOK: query: drop table x PREHOOK: type: DROPTABLE PREHOOK: Input: default@x PREHOOK: Output: default@x POSTHOOK: query: drop table x POSTHOOK: type: DROPTABLE POSTHOOK: Input: default@x POSTHOOK: Output: default@x PREHOOK: query: drop table y PREHOOK: type: DROPTABLE PREHOOK: Input: default@y PREHOOK: Output: default@y POSTHOOK: query: drop table y POSTHOOK: type: DROPTABLE POSTHOOK: Input: default@y POSTHOOK: Output: default@y PREHOOK: query: drop table z PREHOOK: type: DROPTABLE PREHOOK: Input: default@z PREHOOK: Output: default@z POSTHOOK: query: drop table z POSTHOOK: type: DROPTABLE POSTHOOK: Input: default@z POSTHOOK: Output: default@z