PREHOOK: query: CREATE TABLE T1(key STRING, value STRING) STORED AS TEXTFILE PREHOOK: type: CREATETABLE POSTHOOK: query: CREATE TABLE T1(key STRING, value STRING) STORED AS TEXTFILE POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@T1 PREHOOK: query: LOAD DATA LOCAL INPATH '../data/files/T1.txt' INTO TABLE T1 PREHOOK: type: LOAD PREHOOK: Output: default@t1 POSTHOOK: query: LOAD DATA LOCAL INPATH '../data/files/T1.txt' INTO TABLE T1 POSTHOOK: type: LOAD POSTHOOK: Output: default@t1 PREHOOK: query: drop table array_valued_T1 PREHOOK: type: DROPTABLE POSTHOOK: query: drop table array_valued_T1 POSTHOOK: type: DROPTABLE PREHOOK: query: create table array_valued_T1 (key string, value array) SKEWED BY (key) ON ((8)) PREHOOK: type: CREATETABLE POSTHOOK: query: create table array_valued_T1 (key string, value array) SKEWED BY (key) ON ((8)) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@array_valued_T1 PREHOOK: query: insert overwrite table array_valued_T1 select key, array(value) from T1 PREHOOK: type: QUERY PREHOOK: Input: default@t1 PREHOOK: Output: default@array_valued_t1 POSTHOOK: query: insert overwrite table array_valued_T1 select key, array(value) from T1 POSTHOOK: type: QUERY POSTHOOK: Input: default@t1 POSTHOOK: Output: default@array_valued_t1 POSTHOOK: Lineage: array_valued_t1.key SIMPLE [(t1)t1.FieldSchema(name:key, type:string, comment:null), ] POSTHOOK: Lineage: array_valued_t1.value EXPRESSION [(t1)t1.FieldSchema(name:value, type:string, comment:null), ] PREHOOK: query: -- This test is to verify the skew join compile optimization when the join is followed by a lateral view -- adding a order by at the end to make the results deterministic explain select * from (select a.key as key, b.value as array_val from T1 a join array_valued_T1 b on a.key=b.key) i lateral view explode (array_val) c as val PREHOOK: type: QUERY POSTHOOK: query: -- This test is to verify the skew join compile optimization when the join is followed by a lateral view -- adding a order by at the end to make the results deterministic explain select * from (select a.key as key, b.value as array_val from T1 a join array_valued_T1 b on a.key=b.key) i lateral view explode (array_val) c as val POSTHOOK: type: QUERY POSTHOOK: Lineage: array_valued_t1.key SIMPLE [(t1)t1.FieldSchema(name:key, type:string, comment:null), ] POSTHOOK: Lineage: array_valued_t1.value EXPRESSION [(t1)t1.FieldSchema(name:value, type:string, comment:null), ] ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_LATERAL_VIEW (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION explode (TOK_TABLE_OR_COL array_val)) val (TOK_TABALIAS c))) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME T1) a) (TOK_TABREF (TOK_TABNAME array_valued_T1) b) (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key) key) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) value) array_val)))) i))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)))) STAGE DEPENDENCIES: Stage-1 is a root stage Stage-2 depends on stages: Stage-1, Stage-3 Stage-3 is a root stage Stage-0 is a root stage STAGE PLANS: Stage: Stage-1 Map Reduce Alias -> Map Operator Tree: subquery1:a TableScan alias: a Filter Operator predicate: expr: (not (key = '8')) 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 subquery1:b TableScan alias: b Filter Operator predicate: expr: (not (key = '8')) 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: value type: array Reduce Operator Tree: Join Operator condition map: Inner Join 0 to 1 condition expressions: 0 {VALUE._col0} 1 {VALUE._col1} handleSkewJoin: false outputColumnNames: _col0, _col5 Select Operator expressions: expr: _col0 type: string expr: _col5 type: array outputColumnNames: _col0, _col1 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 #### TableScan Union Select Operator SELECT * : (no compute) Lateral View Forward Select Operator SELECT * : (no compute) Lateral View Join Operator outputColumnNames: _col0, _col1, _col2 Select Operator expressions: expr: _col0 type: string expr: _col1 type: array expr: _col2 type: string outputColumnNames: _col0, _col1, _col2 File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat Select Operator expressions: expr: _col1 type: array outputColumnNames: _col0 UDTF Operator function name: explode Lateral View Join Operator outputColumnNames: _col0, _col1, _col2 Select Operator expressions: expr: _col0 type: string expr: _col1 type: array expr: _col2 type: string outputColumnNames: _col0, _col1, _col2 File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat #### A masked pattern was here #### TableScan Union Select Operator SELECT * : (no compute) Lateral View Forward Select Operator SELECT * : (no compute) Lateral View Join Operator outputColumnNames: _col0, _col1, _col2 Select Operator expressions: expr: _col0 type: string expr: _col1 type: array expr: _col2 type: string outputColumnNames: _col0, _col1, _col2 File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat Select Operator expressions: expr: _col1 type: array outputColumnNames: _col0 UDTF Operator function name: explode Lateral View Join Operator outputColumnNames: _col0, _col1, _col2 Select Operator expressions: expr: _col0 type: string expr: _col1 type: array expr: _col2 type: string outputColumnNames: _col0, _col1, _col2 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-3 Map Reduce Alias -> Map Operator Tree: i:a TableScan alias: a Filter Operator predicate: expr: (key = '8') 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 i:b TableScan alias: b Filter Operator predicate: expr: (key = '8') 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: value type: array Reduce Operator Tree: Join Operator condition map: Inner Join 0 to 1 condition expressions: 0 {VALUE._col0} 1 {VALUE._col1} handleSkewJoin: false outputColumnNames: _col0, _col5 Select Operator expressions: expr: _col0 type: string expr: _col5 type: array outputColumnNames: _col0, _col1 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-0 Fetch Operator limit: -1 PREHOOK: query: select * from (select a.key as key, b.value as array_val from T1 a join array_valued_T1 b on a.key=b.key) i lateral view explode (array_val) c as val ORDER BY key, val PREHOOK: type: QUERY PREHOOK: Input: default@array_valued_t1 PREHOOK: Input: default@t1 #### A masked pattern was here #### POSTHOOK: query: select * from (select a.key as key, b.value as array_val from T1 a join array_valued_T1 b on a.key=b.key) i lateral view explode (array_val) c as val ORDER BY key, val POSTHOOK: type: QUERY POSTHOOK: Input: default@array_valued_t1 POSTHOOK: Input: default@t1 #### A masked pattern was here #### POSTHOOK: Lineage: array_valued_t1.key SIMPLE [(t1)t1.FieldSchema(name:key, type:string, comment:null), ] POSTHOOK: Lineage: array_valued_t1.value EXPRESSION [(t1)t1.FieldSchema(name:value, type:string, comment:null), ] 1 ["11"] 11 2 ["12"] 12 3 ["13"] 13 7 ["17"] 17 8 ["18"] 18 8 ["18"] 18 8 ["28"] 28 8 ["28"] 28