PREHOOK: query: -- This test is used for testing the ColumnAccessAnalyzer CREATE TABLE T1(key STRING, val STRING) STORED AS TEXTFILE PREHOOK: type: CREATETABLE PREHOOK: query: LOAD DATA LOCAL INPATH '../data/files/T1.txt' INTO TABLE T1 PREHOOK: type: LOAD PREHOOK: Output: default@t1 PREHOOK: query: CREATE TABLE T2(key STRING, val STRING) STORED AS TEXTFILE PREHOOK: type: CREATETABLE PREHOOK: query: CREATE TABLE T3(key STRING, val STRING) STORED AS TEXTFILE PREHOOK: type: CREATETABLE PREHOOK: query: CREATE TABLE T4(key STRING, val STRING) PARTITIONED BY (p STRING) PREHOOK: type: CREATETABLE PREHOOK: query: -- Simple select queries SELECT key FROM T1 ORDER BY key PREHOOK: type: QUERY PREHOOK: Input: default@t1 #### A masked pattern was here #### Table:default@t1 Columns:key 1 2 3 7 8 8 PREHOOK: query: SELECT key, val FROM T1 ORDER BY key, val PREHOOK: type: QUERY PREHOOK: Input: default@t1 #### A masked pattern was here #### Table:default@t1 Columns:key,val 1 11 2 12 3 13 7 17 8 18 8 28 PREHOOK: query: SELECT 1 FROM T1 PREHOOK: type: QUERY PREHOOK: Input: default@t1 #### A masked pattern was here #### 1 1 1 1 1 1 PREHOOK: query: SELECT key, val from T4 where p=1 PREHOOK: type: QUERY PREHOOK: Input: default@t4 #### A masked pattern was here #### Table:default@t4 Columns:key,val PREHOOK: query: SELECT val FROM T4 where p=1 PREHOOK: type: QUERY PREHOOK: Input: default@t4 #### A masked pattern was here #### Table:default@t4 Columns:val PREHOOK: query: SELECT p, val FROM T4 where p=1 PREHOOK: type: QUERY PREHOOK: Input: default@t4 #### A masked pattern was here #### Table:default@t4 Columns:val PREHOOK: query: -- More complicated select queries EXPLAIN SELECT key FROM (SELECT key, val FROM T1) subq1 ORDER BY key PREHOOK: type: QUERY ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME T1))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL val))))) subq1)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key))) (TOK_ORDERBY (TOK_TABSORTCOLNAMEASC (TOK_TABLE_OR_COL key))))) 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: subq1:t1 TableScan alias: t1 Select Operator expressions: expr: key type: string outputColumnNames: _col0 Reduce Output Operator key expressions: expr: _col0 type: string sort order: + tag: -1 value expressions: expr: _col0 type: string Reduce Operator Tree: Extract 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: SELECT key FROM (SELECT key, val FROM T1) subq1 ORDER BY key PREHOOK: type: QUERY PREHOOK: Input: default@t1 #### A masked pattern was here #### Table:default@t1 Columns:key 1 2 3 7 8 8 PREHOOK: query: EXPLAIN SELECT k FROM (SELECT key as k, val as v FROM T1) subq1 ORDER BY k PREHOOK: type: QUERY ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME T1))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key) k) (TOK_SELEXPR (TOK_TABLE_OR_COL val) v)))) subq1)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL k))) (TOK_ORDERBY (TOK_TABSORTCOLNAMEASC (TOK_TABLE_OR_COL k))))) 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: subq1:t1 TableScan alias: t1 Select Operator expressions: expr: key type: string outputColumnNames: _col0 Reduce Output Operator key expressions: expr: _col0 type: string sort order: + tag: -1 value expressions: expr: _col0 type: string Reduce Operator Tree: Extract 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: SELECT k FROM (SELECT key as k, val as v FROM T1) subq1 ORDER BY k PREHOOK: type: QUERY PREHOOK: Input: default@t1 #### A masked pattern was here #### Table:default@t1 Columns:key 1 2 3 7 8 8 PREHOOK: query: SELECT key + 1 as k FROM T1 ORDER BY k PREHOOK: type: QUERY PREHOOK: Input: default@t1 #### A masked pattern was here #### Table:default@t1 Columns:key 2.0 3.0 4.0 8.0 9.0 9.0 PREHOOK: query: SELECT key + val as k FROM T1 ORDER BY k PREHOOK: type: QUERY PREHOOK: Input: default@t1 #### A masked pattern was here #### Table:default@t1 Columns:key,val 12.0 14.0 16.0 24.0 26.0 36.0 PREHOOK: query: -- Work with union EXPLAIN SELECT * FROM ( SELECT key as c FROM T1 UNION ALL SELECT val as c FROM T1 ) subq1 ORDER BY c PREHOOK: type: QUERY ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_UNION (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME T1))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key) c)))) (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME T1))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL val) c))))) subq1)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_ORDERBY (TOK_TABSORTCOLNAMEASC (TOK_TABLE_OR_COL c))))) 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: null-subquery1:subq1-subquery1:t1 TableScan alias: t1 Select Operator expressions: expr: key type: string outputColumnNames: _col0 Union Select Operator expressions: expr: _col0 type: string outputColumnNames: _col0 Reduce Output Operator key expressions: expr: _col0 type: string sort order: + tag: -1 value expressions: expr: _col0 type: string null-subquery2:subq1-subquery2:t1 TableScan alias: t1 Select Operator expressions: expr: val type: string outputColumnNames: _col0 Union Select Operator expressions: expr: _col0 type: string outputColumnNames: _col0 Reduce Output Operator key expressions: expr: _col0 type: string sort order: + tag: -1 value expressions: expr: _col0 type: string Reduce Operator Tree: Extract 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: SELECT * FROM ( SELECT key as c FROM T1 UNION ALL SELECT val as c FROM T1 ) subq1 ORDER BY c PREHOOK: type: QUERY PREHOOK: Input: default@t1 #### A masked pattern was here #### Table:default@t1 Columns:key,val 1 11 12 13 17 18 2 28 3 7 8 8 PREHOOK: query: EXPLAIN SELECT * FROM ( SELECT key as c FROM T1 UNION ALL SELECT key as c FROM T1 ) subq1 ORDER BY c PREHOOK: type: QUERY ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_UNION (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME T1))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key) c)))) (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME T1))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key) c))))) subq1)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_ORDERBY (TOK_TABSORTCOLNAMEASC (TOK_TABLE_OR_COL c))))) 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: null-subquery1:subq1-subquery1:t1 TableScan alias: t1 Select Operator expressions: expr: key type: string outputColumnNames: _col0 Union Select Operator expressions: expr: _col0 type: string outputColumnNames: _col0 Reduce Output Operator key expressions: expr: _col0 type: string sort order: + tag: -1 value expressions: expr: _col0 type: string null-subquery2:subq1-subquery2:t1 TableScan alias: t1 Select Operator expressions: expr: key type: string outputColumnNames: _col0 Union Select Operator expressions: expr: _col0 type: string outputColumnNames: _col0 Reduce Output Operator key expressions: expr: _col0 type: string sort order: + tag: -1 value expressions: expr: _col0 type: string Reduce Operator Tree: Extract 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: SELECT * FROM ( SELECT key as c FROM T1 UNION ALL SELECT key as c FROM T1 ) subq1 ORDER BY c PREHOOK: type: QUERY PREHOOK: Input: default@t1 #### A masked pattern was here #### Table:default@t1 Columns:key 1 1 2 2 3 3 7 7 8 8 8 8 PREHOOK: query: -- Work with insert overwrite FROM T1 INSERT OVERWRITE TABLE T2 SELECT key, count(1) GROUP BY key INSERT OVERWRITE TABLE T3 SELECT key, sum(val) GROUP BY key PREHOOK: type: QUERY PREHOOK: Input: default@t1 PREHOOK: Output: default@t2 PREHOOK: Output: default@t3 Table:default@t1 Columns:key,val PREHOOK: query: -- Simple joins SELECT * FROM T1 JOIN T2 ON T1.key = T2.key ORDER BY T1.key, T1.val, T2.key, T2.val PREHOOK: type: QUERY PREHOOK: Input: default@t1 PREHOOK: Input: default@t2 #### A masked pattern was here #### Table:default@t2 Columns:key,val Table:default@t1 Columns:key,val 1 11 1 1 2 12 2 1 3 13 3 1 7 17 7 1 8 18 8 2 8 28 8 2 PREHOOK: query: EXPLAIN SELECT T1.key FROM T1 JOIN T2 ON T1.key = T2.key ORDER BY T1.key PREHOOK: type: QUERY ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME T1)) (TOK_TABREF (TOK_TABNAME T2)) (= (. (TOK_TABLE_OR_COL T1) key) (. (TOK_TABLE_OR_COL T2) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL T1) key))) (TOK_ORDERBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL T1) key))))) STAGE DEPENDENCIES: Stage-1 is a root stage Stage-2 depends on stages: Stage-1 Stage-0 is a root stage STAGE PLANS: Stage: Stage-1 Map Reduce Alias -> Map Operator Tree: t1 TableScan alias: t1 Reduce Output Operator key expressions: expr: key type: string sort order: + Map-reduce partition columns: expr: key type: string tag: 0 value expressions: expr: key type: string t2 TableScan alias: t2 Reduce Output Operator key expressions: expr: key type: string sort order: + Map-reduce partition columns: expr: key type: string tag: 1 Reduce Operator Tree: Join Operator condition map: Inner Join 0 to 1 condition expressions: 0 {VALUE._col0} 1 handleSkewJoin: false outputColumnNames: _col0 Select Operator expressions: expr: _col0 type: string outputColumnNames: _col0 File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Stage: Stage-2 Map Reduce Alias -> Map Operator Tree: #### A masked pattern was here #### Reduce Output Operator key expressions: expr: _col0 type: string sort order: + tag: -1 value expressions: expr: _col0 type: string Reduce Operator Tree: Extract 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: SELECT T1.key FROM T1 JOIN T2 ON T1.key = T2.key ORDER BY T1.key PREHOOK: type: QUERY PREHOOK: Input: default@t1 PREHOOK: Input: default@t2 #### A masked pattern was here #### Table:default@t2 Columns:key Table:default@t1 Columns:key 1 2 3 7 8 8 PREHOOK: query: SELECT * FROM T1 JOIN T2 ON T1.key = T2.key AND T1.val = T2.val ORDER BY T1.key, T1.val PREHOOK: type: QUERY PREHOOK: Input: default@t1 PREHOOK: Input: default@t2 #### A masked pattern was here #### Table:default@t2 Columns:key,val Table:default@t1 Columns:key,val PREHOOK: query: -- Map join SELECT /*+ MAPJOIN(a) */ * FROM T1 a JOIN T2 b ON a.key = b.key ORDER BY a.key, a.val, b.key, b.val PREHOOK: type: QUERY PREHOOK: Input: default@t1 PREHOOK: Input: default@t2 #### A masked pattern was here #### Table:default@t2 Columns:key,val Table:default@t1 Columns:key,val 1 11 1 1 2 12 2 1 3 13 3 1 7 17 7 1 8 18 8 2 8 28 8 2 PREHOOK: query: -- More joins EXPLAIN SELECT * FROM T1 JOIN T2 ON T1.key = T2.key AND T1.val = 3 and T2.val = 3 ORDER BY T1.key, T1.val PREHOOK: type: QUERY ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME T1)) (TOK_TABREF (TOK_TABNAME T2)) (and (AND (= (. (TOK_TABLE_OR_COL T1) key) (. (TOK_TABLE_OR_COL T2) key)) (= (. (TOK_TABLE_OR_COL T1) val) 3)) (= (. (TOK_TABLE_OR_COL T2) val) 3)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_ORDERBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL T1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL T1) val))))) STAGE DEPENDENCIES: Stage-1 is a root stage Stage-2 depends on stages: Stage-1 Stage-0 is a root stage STAGE PLANS: Stage: Stage-1 Map Reduce Alias -> Map Operator Tree: t1 TableScan alias: t1 Filter Operator predicate: expr: (val = 3) type: boolean Reduce Output Operator key expressions: expr: key type: string sort order: + Map-reduce partition columns: expr: key type: string tag: 0 value expressions: expr: key type: string expr: val type: string t2 TableScan alias: t2 Filter Operator predicate: expr: (val = 3) type: boolean Reduce Output Operator key expressions: expr: key type: string sort order: + Map-reduce partition columns: expr: key type: string tag: 1 value expressions: expr: key type: string expr: val type: string Reduce Operator Tree: Join Operator condition map: Inner Join 0 to 1 condition expressions: 0 {VALUE._col0} {VALUE._col1} 1 {VALUE._col0} {VALUE._col1} handleSkewJoin: false outputColumnNames: _col0, _col1, _col4, _col5 Select Operator expressions: expr: _col0 type: string expr: _col1 type: string expr: _col4 type: string expr: _col5 type: string outputColumnNames: _col0, _col1, _col2, _col3 File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Stage: Stage-2 Map Reduce Alias -> Map Operator Tree: #### A masked pattern was here #### Reduce Output Operator key expressions: expr: _col0 type: string expr: _col1 type: string sort order: ++ tag: -1 value expressions: expr: _col0 type: string expr: _col1 type: string expr: _col2 type: string expr: _col3 type: string Reduce Operator Tree: Extract 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: SELECT * FROM T1 JOIN T2 ON T1.key = T2.key AND T1.val = 3 and T2.val = 3 ORDER BY T1.key, T1.val PREHOOK: type: QUERY PREHOOK: Input: default@t1 PREHOOK: Input: default@t2 #### A masked pattern was here #### Table:default@t2 Columns:key,val Table:default@t1 Columns:key,val PREHOOK: query: EXPLAIN SELECT subq1.val FROM ( SELECT val FROM T1 WHERE key = 5 ) subq1 JOIN ( SELECT val FROM T2 WHERE key = 6 ) subq2 ON subq1.val = subq2.val ORDER BY subq1.val PREHOOK: type: QUERY ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME T1))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL val))) (TOK_WHERE (= (TOK_TABLE_OR_COL key) 5)))) subq1) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME T2))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL val))) (TOK_WHERE (= (TOK_TABLE_OR_COL key) 6)))) subq2) (= (. (TOK_TABLE_OR_COL subq1) val) (. (TOK_TABLE_OR_COL subq2) val)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq1) val))) (TOK_ORDERBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL subq1) val))))) STAGE DEPENDENCIES: Stage-1 is a root stage Stage-2 depends on stages: Stage-1 Stage-0 is a root stage STAGE PLANS: Stage: Stage-1 Map Reduce Alias -> Map Operator Tree: subq1:t1 TableScan alias: t1 Filter Operator predicate: expr: (key = 5) type: boolean Select Operator expressions: expr: val type: string outputColumnNames: _col0 Reduce Output Operator key expressions: expr: _col0 type: string sort order: + Map-reduce partition columns: expr: _col0 type: string tag: 0 value expressions: expr: _col0 type: string subq2:t2 TableScan alias: t2 Filter Operator predicate: expr: (key = 6) type: boolean Select Operator expressions: expr: val type: string outputColumnNames: _col0 Reduce Output Operator key expressions: expr: _col0 type: string sort order: + Map-reduce partition columns: expr: _col0 type: string tag: 1 Reduce Operator Tree: Join Operator condition map: Inner Join 0 to 1 condition expressions: 0 {VALUE._col0} 1 handleSkewJoin: false outputColumnNames: _col0 Select Operator expressions: expr: _col0 type: string outputColumnNames: _col0 File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Stage: Stage-2 Map Reduce Alias -> Map Operator Tree: #### A masked pattern was here #### Reduce Output Operator key expressions: expr: _col0 type: string sort order: + tag: -1 value expressions: expr: _col0 type: string Reduce Operator Tree: Extract 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: SELECT subq1.val FROM ( SELECT val FROM T1 WHERE key = 5 ) subq1 JOIN ( SELECT val FROM T2 WHERE key = 6 ) subq2 ON subq1.val = subq2.val ORDER BY subq1.val PREHOOK: type: QUERY PREHOOK: Input: default@t1 PREHOOK: Input: default@t2 #### A masked pattern was here #### Table:default@t2 Columns:key,val Table:default@t1 Columns:key,val PREHOOK: query: -- Join followed by join EXPLAIN SELECT * FROM ( SELECT subq1.key as key FROM ( SELECT key, val FROM T1 ) subq1 JOIN ( SELECT key, 'teststring' as val FROM T2 ) subq2 ON subq1.key = subq2.key ) T4 JOIN T3 ON T3.key = T4.key ORDER BY T3.key, T4.key PREHOOK: type: QUERY ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME T1))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL val))))) subq1) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME T2))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR 'teststring' val)))) subq2) (= (. (TOK_TABLE_OR_COL subq1) key) (. (TOK_TABLE_OR_COL subq2) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq1) key) key)))) T4) (TOK_TABREF (TOK_TABNAME T3)) (= (. (TOK_TABLE_OR_COL T3) key) (. (TOK_TABLE_OR_COL T4) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_ORDERBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL T3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL T4) key))))) STAGE DEPENDENCIES: Stage-3 is a root stage Stage-1 depends on stages: Stage-3 Stage-2 depends on stages: Stage-1 Stage-0 is a root stage STAGE PLANS: Stage: Stage-3 Map Reduce Alias -> Map Operator Tree: t4:subq1:t1 TableScan alias: t1 Select Operator expressions: expr: key type: string outputColumnNames: _col0 Reduce Output Operator key expressions: expr: _col0 type: string sort order: + Map-reduce partition columns: expr: _col0 type: string tag: 0 value expressions: expr: _col0 type: string t4:subq2:t2 TableScan alias: t2 Select Operator expressions: expr: key type: string outputColumnNames: _col0 Reduce Output Operator key expressions: expr: _col0 type: string sort order: + Map-reduce partition columns: expr: _col0 type: string tag: 1 Reduce Operator Tree: Join Operator condition map: Inner Join 0 to 1 condition expressions: 0 {VALUE._col0} 1 handleSkewJoin: false outputColumnNames: _col0 Select Operator expressions: expr: _col0 type: string outputColumnNames: _col0 File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Stage: Stage-1 Map Reduce Alias -> Map Operator Tree: $INTNAME Reduce Output Operator key expressions: expr: _col0 type: string sort order: + Map-reduce partition columns: expr: _col0 type: string tag: 0 value expressions: expr: _col0 type: string t3 TableScan alias: t3 Reduce Output Operator key expressions: expr: key type: string sort order: + Map-reduce partition columns: expr: key type: string tag: 1 value expressions: expr: key type: string expr: val type: string Reduce Operator Tree: Join Operator condition map: Inner Join 0 to 1 condition expressions: 0 {VALUE._col0} 1 {VALUE._col0} {VALUE._col1} handleSkewJoin: false outputColumnNames: _col0, _col1, _col2 Select Operator expressions: expr: _col0 type: string expr: _col1 type: string expr: _col2 type: string outputColumnNames: _col0, _col1, _col2 File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Stage: Stage-2 Map Reduce Alias -> Map Operator Tree: #### A masked pattern was here #### Reduce Output Operator key expressions: expr: _col1 type: string expr: _col0 type: string sort order: ++ tag: -1 value expressions: expr: _col0 type: string expr: _col1 type: string expr: _col2 type: string Reduce Operator Tree: Extract 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: SELECT * FROM ( SELECT subq1.key as key FROM ( SELECT key, val FROM T1 ) subq1 JOIN ( SELECT key, 'teststring' as val FROM T2 ) subq2 ON subq1.key = subq2.key ) T4 JOIN T3 ON T3.key = T4.key ORDER BY T3.key, T4.key PREHOOK: type: QUERY PREHOOK: Input: default@t1 PREHOOK: Input: default@t2 PREHOOK: Input: default@t3 #### A masked pattern was here #### Table:default@t2 Columns:key Table:default@t1 Columns:key Table:default@t3 Columns:key,val 1 1 11.0 2 2 12.0 3 3 13.0 7 7 17.0 8 8 46.0 8 8 46.0