Index: conf/hive-default.xml.template =================================================================== --- conf/hive-default.xml.template (revision 1457610) +++ conf/hive-default.xml.template (working copy) @@ -810,7 +810,7 @@ hive.auto.convert.join.noconditionaltask - false + true Whether Hive enable the optimization about converting common join into mapjoin based on the input file size. If this paramater is on, and the sum of size for n-1 of the tables/partitions for a n-way join is smaller than the specified size, the join is directly converted to a mapjoin (there is no conditional task). Index: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java =================================================================== --- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (revision 1457610) +++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (working copy) @@ -484,7 +484,7 @@ HIVESKEWJOIN("hive.optimize.skewjoin", false), HIVECONVERTJOIN("hive.auto.convert.join", true), - HIVECONVERTJOINNOCONDITIONALTASK("hive.auto.convert.join.noconditionaltask", false), + HIVECONVERTJOINNOCONDITIONALTASK("hive.auto.convert.join.noconditionaltask", true), HIVECONVERTJOINNOCONDITIONALTASKTHRESHOLD("hive.auto.convert.join.noconditionaltask.size", 10000000L), HIVESKEWJOINKEY("hive.skewjoin.key", 100000), Index: ql/src/test/results/clientpositive/auto_join13.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join13.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join13.q.out (working copy) @@ -24,59 +24,22 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) key) c1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) value) c2)))) src1) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) key) c3) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) value) c4)))) src2) (AND (= (. (TOK_TABLE_OR_COL src1) c1) (. (TOK_TABLE_OR_COL src2) c3)) (< (. (TOK_TABLE_OR_COL src1) c1) 100))) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) key) c5) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) value) c6)))) src3) (AND (= (+ (. (TOK_TABLE_OR_COL src1) c1) (. (TOK_TABLE_OR_COL src2) c3)) (. (TOK_TABLE_OR_COL src3) c5)) (< (. (TOK_TABLE_OR_COL src3) c5) 200)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION hash (. (TOK_TABLE_OR_COL src1) c1) (. (TOK_TABLE_OR_COL src2) c4))))))) STAGE DEPENDENCIES: - Stage-11 is a root stage , consists of Stage-14, Stage-15, Stage-1 - Stage-14 has a backup stage: Stage-1 - Stage-9 depends on stages: Stage-14 - Stage-8 depends on stages: Stage-1, Stage-9, Stage-10 , consists of Stage-12, Stage-13, Stage-2 - Stage-12 has a backup stage: Stage-2 - Stage-6 depends on stages: Stage-12 - Stage-3 depends on stages: Stage-2, Stage-6, Stage-7 - Stage-13 has a backup stage: Stage-2 - Stage-7 depends on stages: Stage-13 - Stage-2 - Stage-15 has a backup stage: Stage-1 - Stage-10 depends on stages: Stage-15 - Stage-1 + Stage-8 is a root stage + Stage-7 depends on stages: Stage-8 + Stage-3 depends on stages: Stage-7 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-11 - Conditional Operator - - Stage: Stage-14 + Stage: Stage-8 Map Reduce Local Work Alias -> Map Local Tables: - src2:src + src1:src Fetch Operator limit: -1 + src3:src + Fetch Operator + limit: -1 Alias -> Map Local Operator Tree: - src2:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 100.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - HashTable Sink Operator - condition expressions: - 0 {_col0} - 1 {_col0} {_col1} - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 0 - - Stage: Stage-9 - Map Reduce - Alias -> Map Operator Tree: src1:src TableScan alias: src @@ -89,9 +52,7 @@ expr: key type: string outputColumnNames: _col0 - Map Join Operator - condition map: - Inner Join 0 to 1 + HashTable Sink Operator condition expressions: 0 {_col0} 1 {_col0} {_col1} @@ -99,28 +60,8 @@ keys: 0 [Column[_col0]] 1 [Column[_col0]] - outputColumnNames: _col0, _col2, _col3 - Position of Big Table: 0 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - Local Work: - Map Reduce Local Work - - Stage: Stage-8 - Conditional Operator - - Stage: Stage-12 - Map Reduce Local Work - Alias -> Map Local Tables: + Position of Big Table: 1 src3:src - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src3:src TableScan alias: src Filter Operator @@ -142,41 +83,66 @@ 1 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[_col0]()] Position of Big Table: 0 - Stage: Stage-6 + Stage: Stage-7 Map Reduce Alias -> Map Operator Tree: - $INTNAME - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {_col3} {_col0} - 1 - handleSkewJoin: false - keys: - 0 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[_col0], Column[_col2]()] - 1 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[_col0]()] - outputColumnNames: _col1, _col2 - Position of Big Table: 0 + src2:src + TableScan + alias: src + Filter Operator + predicate: + expr: (key < 100.0) + type: boolean Select Operator expressions: - expr: _col2 + expr: key type: string - expr: _col1 + expr: value type: string - outputColumnNames: _col2, _col1 - Group By Operator - aggregations: - expr: sum(hash(_col2,_col1)) - bucketGroup: false - mode: hash - 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 + outputColumnNames: _col0, _col1 + Map Join Operator + condition map: + Inner Join 0 to 1 + condition expressions: + 0 {_col0} + 1 {_col0} {_col1} + handleSkewJoin: false + keys: + 0 [Column[_col0]] + 1 [Column[_col0]] + outputColumnNames: _col0, _col2, _col3 + Position of Big Table: 1 + Map Join Operator + condition map: + Inner Join 0 to 1 + condition expressions: + 0 {_col3} {_col0} + 1 + handleSkewJoin: false + keys: + 0 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[_col0], Column[_col2]()] + 1 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[_col0]()] + outputColumnNames: _col1, _col2 + Position of Big Table: 0 + Select Operator + expressions: + expr: _col2 + type: string + expr: _col1 + type: string + outputColumnNames: _col2, _col1 + Group By Operator + aggregations: + expr: sum(hash(_col2,_col1)) + bucketGroup: false + mode: hash + 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 Local Work: Map Reduce Local Work @@ -209,279 +175,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-13 - Map Reduce Local Work - Alias -> Map Local Tables: - $INTNAME - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - $INTNAME - HashTable Sink Operator - condition expressions: - 0 {_col3} {_col0} - 1 - handleSkewJoin: false - keys: - 0 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[_col0], Column[_col2]()] - 1 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[_col0]()] - Position of Big Table: 1 - - Stage: Stage-7 - Map Reduce - Alias -> Map Operator Tree: - src3:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 200.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - outputColumnNames: _col0 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {_col3} {_col0} - 1 - handleSkewJoin: false - keys: - 0 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[_col0], Column[_col2]()] - 1 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[_col0]()] - outputColumnNames: _col1, _col2 - Position of Big Table: 1 - Select Operator - expressions: - expr: _col2 - type: string - expr: _col1 - type: string - outputColumnNames: _col2, _col1 - Group By Operator - aggregations: - expr: sum(hash(_col2,_col1)) - bucketGroup: false - mode: hash - 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 - Local Work: - Map Reduce Local Work - - Stage: Stage-2 - Map Reduce - Alias -> Map Operator Tree: - $INTNAME - Reduce Output Operator - key expressions: - expr: (_col0 + _col2) - type: double - sort order: + - Map-reduce partition columns: - expr: (_col0 + _col2) - type: double - tag: 0 - value expressions: - expr: _col3 - type: string - expr: _col0 - type: string - src3:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 200.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - outputColumnNames: _col0 - Reduce Output Operator - key expressions: - expr: UDFToDouble(_col0) - type: double - sort order: + - Map-reduce partition columns: - expr: UDFToDouble(_col0) - type: double - tag: 1 - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {VALUE._col1} {VALUE._col2} - 1 - handleSkewJoin: false - outputColumnNames: _col1, _col2 - Select Operator - expressions: - expr: _col2 - type: string - expr: _col1 - type: string - outputColumnNames: _col2, _col1 - Group By Operator - aggregations: - expr: sum(hash(_col2,_col1)) - bucketGroup: false - mode: hash - 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-15 - Map Reduce Local Work - Alias -> Map Local Tables: - src1:src - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src1:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 100.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - outputColumnNames: _col0 - HashTable Sink Operator - condition expressions: - 0 {_col0} - 1 {_col0} {_col1} - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 1 - - Stage: Stage-10 - Map Reduce - Alias -> Map Operator Tree: - src2:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 100.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {_col0} - 1 {_col0} {_col1} - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - outputColumnNames: _col0, _col2, _col3 - Position of Big Table: 1 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 100.0) - type: boolean - 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 - src2:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 100.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Reduce Output Operator - key expressions: - expr: _col0 - type: string - sort order: + - Map-reduce partition columns: - expr: _col0 - type: string - tag: 1 - value expressions: - expr: _col0 - type: string - expr: _col1 - 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, _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-0 Fetch Operator limit: -1 Index: ql/src/test/results/clientpositive/multi_join_union.q.out =================================================================== --- ql/src/test/results/clientpositive/multi_join_union.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/multi_join_union.q.out (working copy) @@ -40,53 +40,28 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME src11) a) (TOK_TABREF (TOK_TABNAME src12) b) (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key))) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_UNION (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src13))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)))) (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src14))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF))))) a)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)))) c) (= (. (TOK_TABLE_OR_COL c) value) (. (TOK_TABLE_OR_COL b) value)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)))) STAGE DEPENDENCIES: - Stage-11 is a root stage , consists of Stage-14, Stage-15, Stage-1 - Stage-14 has a backup stage: Stage-1 - Stage-9 depends on stages: Stage-14 - Stage-8 depends on stages: Stage-1, Stage-9, Stage-10 , consists of Stage-12, Stage-13, Stage-2 - Stage-12 has a backup stage: Stage-2 - Stage-6 depends on stages: Stage-12 - Stage-13 has a backup stage: Stage-2 - Stage-7 depends on stages: Stage-13 - Stage-2 - Stage-15 has a backup stage: Stage-1 - Stage-10 depends on stages: Stage-15 - Stage-1 + Stage-8 is a root stage + Stage-7 depends on stages: Stage-8 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-11 - Conditional Operator - - Stage: Stage-14 + Stage: Stage-8 Map Reduce Local Work Alias -> Map Local Tables: - b + a Fetch Operator limit: -1 + c-subquery1:a-subquery1:src13 + Fetch Operator + limit: -1 + c-subquery2:a-subquery2:src14 + Fetch Operator + limit: -1 Alias -> Map Local Operator Tree: - b - TableScan - alias: b - HashTable Sink Operator - condition expressions: - 0 {key} {value} - 1 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - Position of Big Table: 0 - - Stage: Stage-9 - Map Reduce - Alias -> Map Operator Tree: a TableScan alias: a - Map Join Operator - condition map: - Inner Join 0 to 1 + HashTable Sink Operator condition expressions: 0 {key} {value} 1 {key} {value} @@ -94,31 +69,8 @@ keys: 0 [Column[key]] 1 [Column[key]] - outputColumnNames: _col0, _col1, _col4, _col5 - Position of Big Table: 0 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - Local Work: - Map Reduce Local Work - - Stage: Stage-8 - Conditional Operator - - Stage: Stage-12 - Map Reduce Local Work - Alias -> Map Local Tables: + Position of Big Table: 1 c-subquery1:a-subquery1:src13 - Fetch Operator - limit: -1 - c-subquery2:a-subquery2:src14 - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - c-subquery1:a-subquery1:src13 TableScan alias: src13 Select Operator @@ -173,312 +125,9 @@ 1 [Column[_col1]] Position of Big Table: 0 - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - $INTNAME - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {_col4} {_col5} {_col0} {_col1} - 1 {_col0} {_col1} - handleSkewJoin: false - keys: - 0 [Column[_col5]] - 1 [Column[_col1]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 0 - Select Operator - expressions: - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col8 - type: string - expr: _col9 - 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-13 - Map Reduce Local Work - Alias -> Map Local Tables: - $INTNAME - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - $INTNAME - HashTable Sink Operator - condition expressions: - 0 {_col4} {_col5} {_col0} {_col1} - 1 {_col0} {_col1} - handleSkewJoin: false - keys: - 0 [Column[_col5]] - 1 [Column[_col1]] - Position of Big Table: 1 - Stage: Stage-7 Map Reduce Alias -> Map Operator Tree: - c-subquery1:a-subquery1:src13 - TableScan - alias: src13 - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Union - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - outputColumnNames: _col0, _col1 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {_col4} {_col5} {_col0} {_col1} - 1 {_col0} {_col1} - handleSkewJoin: false - keys: - 0 [Column[_col5]] - 1 [Column[_col1]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 1 - Select Operator - expressions: - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col8 - type: string - expr: _col9 - 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 - c-subquery2:a-subquery2:src14 - TableScan - alias: src14 - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Union - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - outputColumnNames: _col0, _col1 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {_col4} {_col5} {_col0} {_col1} - 1 {_col0} {_col1} - handleSkewJoin: false - keys: - 0 [Column[_col5]] - 1 [Column[_col1]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 1 - Select Operator - expressions: - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col8 - type: string - expr: _col9 - 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-2 - Map Reduce - Alias -> Map Operator Tree: - $INTNAME - Reduce Output Operator - key expressions: - expr: _col5 - type: string - sort order: + - Map-reduce partition columns: - expr: _col5 - type: string - tag: 0 - value expressions: - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col0 - type: string - expr: _col1 - type: string - c-subquery1:a-subquery1:src13 - TableScan - alias: src13 - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Union - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - outputColumnNames: _col0, _col1 - Reduce Output Operator - key expressions: - expr: _col1 - type: string - sort order: + - Map-reduce partition columns: - expr: _col1 - type: string - tag: 1 - value expressions: - expr: _col0 - type: string - expr: _col1 - type: string - c-subquery2:a-subquery2:src14 - TableScan - alias: src14 - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Union - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - outputColumnNames: _col0, _col1 - Reduce Output Operator - key expressions: - expr: _col1 - type: string - sort order: + - Map-reduce partition columns: - expr: _col1 - type: string - tag: 1 - value expressions: - expr: _col0 - type: string - expr: _col1 - type: string - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} {VALUE._col4} {VALUE._col5} - 1 {VALUE._col0} {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col8 - type: string - expr: _col9 - 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 - - Stage: Stage-15 - Map Reduce Local Work - Alias -> Map Local Tables: - a - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - a - TableScan - alias: a - HashTable Sink Operator - condition expressions: - 0 {key} {value} - 1 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - Position of Big Table: 1 - - Stage: Stage-10 - Map Reduce - Alias -> Map Operator Tree: b TableScan alias: b @@ -494,68 +143,42 @@ 1 [Column[key]] outputColumnNames: _col0, _col1, _col4, _col5 Position of Big Table: 1 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + Map Join Operator + condition map: + Inner Join 0 to 1 + condition expressions: + 0 {_col4} {_col5} {_col0} {_col1} + 1 {_col0} {_col1} + handleSkewJoin: false + keys: + 0 [Column[_col5]] + 1 [Column[_col1]] + outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 + Position of Big Table: 0 + Select Operator + expressions: + expr: _col4 + type: string + expr: _col5 + type: string + expr: _col0 + type: string + expr: _col1 + type: string + expr: _col8 + type: string + expr: _col9 + 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-1 - Map Reduce - Alias -> Map Operator Tree: - a - TableScan - alias: a - 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: value - type: string - b - TableScan - alias: b - 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: value - 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 - 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 Index: ql/src/test/results/clientpositive/auto_join29.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join29.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join29.q.out (working copy) @@ -8,18 +8,13 @@ (TOK_QUERY (TOK_FROM (TOK_RIGHTOUTERJOIN (TOK_LEFTOUTERJOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-7, Stage-1 - Stage-7 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-7 - Stage-2 depends on stages: Stage-1, Stage-5 - Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: Stage: Stage-6 - Conditional Operator - - Stage: Stage-7 Map Reduce Local Work Alias -> Map Local Tables: src1 @@ -161,101 +156,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - 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: value - type: string - src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: (key > 10.0) - 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: value - type: string - src3 - TableScan - alias: src3 - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 2 - value expressions: - expr: key - type: string - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Left Outer Join0 to 1 - Right Outer Join1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - filter predicates: - 0 {(VALUE._col0 < 10.0)} - 1 - 2 {(VALUE._col0 < 10.0)} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - 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 @@ -2885,18 +2785,13 @@ (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_LEFTOUTERJOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-7, Stage-1 - Stage-7 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-7 - Stage-2 depends on stages: Stage-1, Stage-5 - Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: Stage: Stage-6 - Conditional Operator - - Stage: Stage-7 Map Reduce Local Work Alias -> Map Local Tables: src2 @@ -3042,105 +2937,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - 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: value - type: string - src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: (key > 10.0) - 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: value - type: string - src3 - TableScan - alias: src3 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 10.0)) - type: boolean - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 2 - value expressions: - expr: key - type: string - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Left Outer Join0 to 1 - Left Outer Join1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - filter predicates: - 0 {(VALUE._col0 < 10.0)} - 1 - 2 - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - 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 @@ -4180,18 +3976,13 @@ (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_RIGHTOUTERJOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-7, Stage-1 - Stage-7 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-7 - Stage-2 depends on stages: Stage-1, Stage-5 - Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: Stage: Stage-6 - Conditional Operator - - Stage: Stage-7 Map Reduce Local Work Alias -> Map Local Tables: src1 @@ -4337,105 +4128,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: (key < 10.0) - 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: value - type: string - src2 - TableScan - alias: src2 - 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: value - type: string - src3 - TableScan - alias: src3 - Filter Operator - predicate: - expr: (key < 10.0) - type: boolean - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 2 - value expressions: - expr: key - type: string - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Right Outer Join0 to 1 - Left Outer Join1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - filter predicates: - 0 - 1 {(VALUE._col0 > 10.0)} - 2 - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - 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 @@ -5007,18 +4699,13 @@ (TOK_QUERY (TOK_FROM (TOK_RIGHTOUTERJOIN (TOK_RIGHTOUTERJOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-7, Stage-1 - Stage-7 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-7 - Stage-2 depends on stages: Stage-1, Stage-5 - Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: Stage: Stage-6 - Conditional Operator - - Stage: Stage-7 Map Reduce Local Work Alias -> Map Local Tables: src1 @@ -5160,101 +4847,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: (key < 10.0) - 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: value - type: string - src2 - TableScan - alias: src2 - 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: value - type: string - src3 - TableScan - alias: src3 - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 2 - value expressions: - expr: key - type: string - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Right Outer Join0 to 1 - Right Outer Join1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - filter predicates: - 0 - 1 {(VALUE._col0 > 10.0)} - 2 {(VALUE._col0 < 10.0)} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - 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 @@ -6342,35 +5934,28 @@ (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-7 is a root stage , consists of Stage-8, Stage-9, Stage-1 - Stage-8 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-8 - Stage-2 depends on stages: Stage-1, Stage-5, Stage-6 - Stage-9 has a backup stage: Stage-1 - Stage-6 depends on stages: Stage-9 - Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-7 - Conditional Operator - - Stage: Stage-8 + Stage: Stage-6 Map Reduce Local Work Alias -> Map Local Tables: - src2 + src1 Fetch Operator limit: -1 src3 Fetch Operator limit: -1 Alias -> Map Local Operator Tree: - src2 + src1 TableScan - alias: src2 + alias: src1 Filter Operator predicate: - expr: ((key < 10.0) and (key > 10.0)) + expr: ((key > 10.0) and (key < 10.0)) type: boolean HashTable Sink Operator condition expressions: @@ -6382,7 +5967,7 @@ 0 [Column[key]] 1 [Column[key]] 2 [Column[key]] - Position of Big Table: 0 + Position of Big Table: 1 src3 TableScan alias: src3 @@ -6400,17 +5985,17 @@ 0 [Column[key]] 1 [Column[key]] 2 [Column[key]] - Position of Big Table: 0 + Position of Big Table: 1 Stage: Stage-5 Map Reduce Alias -> Map Operator Tree: - src1 + src2 TableScan - alias: src1 + alias: src2 Filter Operator predicate: - expr: ((key > 10.0) and (key < 10.0)) + expr: ((key < 10.0) and (key > 10.0)) type: boolean Map Join Operator condition map: @@ -6426,7 +6011,7 @@ 1 [Column[key]] 2 [Column[key]] outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 0 + Position of Big Table: 1 Select Operator expressions: expr: _col0 @@ -6493,201 +6078,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-9 - Map Reduce Local Work - Alias -> Map Local Tables: - src1 - Fetch Operator - limit: -1 - src3 - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 10.0)) - type: boolean - HashTable Sink Operator - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 1 - src3 - TableScan - alias: src3 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 10.0)) - type: boolean - HashTable Sink Operator - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 1 - - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: ((key < 10.0) and (key > 10.0)) - type: boolean - Map Join Operator - condition map: - Inner Join 0 to 1 - Left Outer Join1 to 2 - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 1 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 10.0)) - 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: value - type: string - src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: ((key < 10.0) and (key > 10.0)) - 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: value - type: string - src3 - TableScan - alias: src3 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 10.0)) - type: boolean - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 2 - value expressions: - expr: key - type: string - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - Left Outer Join1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - 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 @@ -6711,18 +6101,13 @@ (TOK_QUERY (TOK_FROM (TOK_RIGHTOUTERJOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-7, Stage-1 - Stage-7 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-7 - Stage-2 depends on stages: Stage-1, Stage-5 - Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: Stage: Stage-6 - Conditional Operator - - Stage: Stage-7 Map Reduce Local Work Alias -> Map Local Tables: src1 @@ -6868,105 +6253,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 10.0)) - 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: value - type: string - src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: ((key < 10.0) and (key > 10.0)) - 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: value - type: string - src3 - TableScan - alias: src3 - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 2 - value expressions: - expr: key - type: string - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - Right Outer Join1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - filter predicates: - 0 - 1 - 2 {(VALUE._col0 < 10.0)} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - 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 @@ -7490,18 +6776,13 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_LEFTOUTERJOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-7, Stage-1 - Stage-7 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-7 - Stage-2 depends on stages: Stage-1, Stage-5 - Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: Stage: Stage-6 - Conditional Operator - - Stage: Stage-7 Map Reduce Local Work Alias -> Map Local Tables: src2 @@ -7647,105 +6928,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - 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: value - type: string - src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: ((key < 10.0) and (key > 10.0)) - 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: value - type: string - src3 - TableScan - alias: src3 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 10.0)) - type: boolean - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 2 - value expressions: - expr: key - type: string - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Left Outer Join0 to 1 - Inner Join 1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - filter predicates: - 0 {(VALUE._col0 < 10.0)} - 1 - 2 - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - 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 @@ -7769,20 +6951,13 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_RIGHTOUTERJOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-7 is a root stage , consists of Stage-8, Stage-9, Stage-1 - Stage-8 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-8 - Stage-2 depends on stages: Stage-1, Stage-5, Stage-6 - Stage-9 has a backup stage: Stage-1 - Stage-6 depends on stages: Stage-9 - Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-7 - Conditional Operator - - Stage: Stage-8 + Stage: Stage-6 Map Reduce Local Work Alias -> Map Local Tables: src1 @@ -7932,217 +7107,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-9 - Map Reduce Local Work - Alias -> Map Local Tables: - src1 - Fetch Operator - limit: -1 - src2 - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: (key < 10.0) - type: boolean - HashTable Sink Operator - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - filter predicates: - 0 - 1 {(key > 10.0)} - 2 - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 2 - src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: (key < 10.0) - type: boolean - HashTable Sink Operator - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - filter predicates: - 0 - 1 {(key > 10.0)} - 2 - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 2 - - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - src3 - TableScan - alias: src3 - Filter Operator - predicate: - expr: (key < 10.0) - type: boolean - Map Join Operator - condition map: - Right Outer Join0 to 1 - Inner Join 1 to 2 - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - filter predicates: - 0 - 1 {(key > 10.0)} - 2 - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 2 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: (key < 10.0) - 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: value - type: string - src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: (key < 10.0) - 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: value - type: string - src3 - TableScan - alias: src3 - Filter Operator - predicate: - expr: (key < 10.0) - type: boolean - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 2 - value expressions: - expr: key - type: string - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Right Outer Join0 to 1 - Inner Join 1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - filter predicates: - 0 - 1 {(VALUE._col0 > 10.0)} - 2 - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - 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 @@ -8224,37 +7188,28 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-8 is a root stage , consists of Stage-9, Stage-10, Stage-11, Stage-1 - Stage-9 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-9 - Stage-2 depends on stages: Stage-1, Stage-5, Stage-6, Stage-7 - Stage-10 has a backup stage: Stage-1 - Stage-6 depends on stages: Stage-10 - Stage-11 has a backup stage: Stage-1 - Stage-7 depends on stages: Stage-11 - Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-8 - Conditional Operator - - Stage: Stage-9 + Stage: Stage-6 Map Reduce Local Work Alias -> Map Local Tables: - src2 + src1 Fetch Operator limit: -1 src3 Fetch Operator limit: -1 Alias -> Map Local Operator Tree: - src2 + src1 TableScan - alias: src2 + alias: src1 Filter Operator predicate: - expr: ((key < 10.0) and (key > 10.0)) + expr: ((key > 10.0) and (key < 10.0)) type: boolean HashTable Sink Operator condition expressions: @@ -8266,7 +7221,7 @@ 0 [Column[key]] 1 [Column[key]] 2 [Column[key]] - Position of Big Table: 0 + Position of Big Table: 1 src3 TableScan alias: src3 @@ -8284,17 +7239,17 @@ 0 [Column[key]] 1 [Column[key]] 2 [Column[key]] - Position of Big Table: 0 + Position of Big Table: 1 Stage: Stage-5 Map Reduce Alias -> Map Operator Tree: - src1 + src2 TableScan - alias: src1 + alias: src2 Filter Operator predicate: - expr: ((key > 10.0) and (key < 10.0)) + expr: ((key < 10.0) and (key > 10.0)) type: boolean Map Join Operator condition map: @@ -8310,7 +7265,7 @@ 1 [Column[key]] 2 [Column[key]] outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 0 + Position of Big Table: 1 Select Operator expressions: expr: _col0 @@ -8377,297 +7332,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-10 - Map Reduce Local Work - Alias -> Map Local Tables: - src1 - Fetch Operator - limit: -1 - src3 - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 10.0)) - type: boolean - HashTable Sink Operator - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 1 - src3 - TableScan - alias: src3 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 10.0)) - type: boolean - HashTable Sink Operator - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 1 - - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: ((key < 10.0) and (key > 10.0)) - type: boolean - Map Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 1 to 2 - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 1 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - Local Work: - Map Reduce Local Work - - Stage: Stage-11 - Map Reduce Local Work - Alias -> Map Local Tables: - src1 - Fetch Operator - limit: -1 - src2 - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 10.0)) - type: boolean - HashTable Sink Operator - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 2 - src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: ((key < 10.0) and (key > 10.0)) - type: boolean - HashTable Sink Operator - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 2 - - Stage: Stage-7 - Map Reduce - Alias -> Map Operator Tree: - src3 - TableScan - alias: src3 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 10.0)) - type: boolean - Map Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 1 to 2 - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 2 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 10.0)) - 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: value - type: string - src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: ((key < 10.0) and (key > 10.0)) - 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: value - type: string - src3 - TableScan - alias: src3 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 10.0)) - type: boolean - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 2 - value expressions: - expr: key - type: string - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - 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 Index: ql/src/test/results/clientpositive/reduce_deduplicate_exclude_join.q.out =================================================================== --- ql/src/test/results/clientpositive/reduce_deduplicate_exclude_join.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/reduce_deduplicate_exclude_join.q.out (working copy) @@ -7,12 +7,8 @@ STAGE DEPENDENCIES: Stage-2 is a root stage - Stage-5 depends on stages: Stage-2 , consists of Stage-6, Stage-7, Stage-1 - Stage-6 has a backup stage: Stage-1 - Stage-3 depends on stages: Stage-6 - Stage-7 has a backup stage: Stage-1 - Stage-4 depends on stages: Stage-7 - Stage-1 + Stage-4 depends on stages: Stage-2 + Stage-3 depends on stages: Stage-4 Stage-0 is a root stage STAGE PLANS: @@ -52,10 +48,7 @@ input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - Stage: Stage-5 - Conditional Operator - - Stage: Stage-6 + Stage: Stage-4 Map Reduce Local Work Alias -> Map Local Tables: b @@ -112,126 +105,6 @@ Local Work: Map Reduce Local Work - Stage: Stage-7 - Map Reduce Local Work - Alias -> Map Local Tables: - $INTNAME - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - $INTNAME - HashTable Sink Operator - condition expressions: - 0 {_col0} {_col1} - 1 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[key]] - Position of Big Table: 1 - - Stage: Stage-4 - Map Reduce - Alias -> Map Operator Tree: - b - TableScan - alias: b - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {_col0} {_col1} - 1 {key} {value} - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[key]] - outputColumnNames: _col0, _col1, _col2, _col3 - Position of Big Table: 1 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col2 - type: string - expr: _col3 - type: string - outputColumnNames: _col0, _col1, _col2, _col3 - Limit - 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-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 - expr: _col1 - type: string - b - TableScan - alias: b - 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: value - 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, _col2, _col3 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col2 - type: string - expr: _col3 - type: string - outputColumnNames: _col0, _col1, _col2, _col3 - Limit - 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 Index: ql/src/test/results/clientpositive/auto_join12.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join12.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join12.q.out (working copy) @@ -24,45 +24,34 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) key) c1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) value) c2)))) src1) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) key) c3) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) value) c4)))) src2) (AND (= (. (TOK_TABLE_OR_COL src1) c1) (. (TOK_TABLE_OR_COL src2) c3)) (< (. (TOK_TABLE_OR_COL src1) c1) 100))) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) key) c5) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) value) c6)))) src3) (AND (= (. (TOK_TABLE_OR_COL src1) c1) (. (TOK_TABLE_OR_COL src3) c5)) (< (. (TOK_TABLE_OR_COL src3) c5) 80)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION hash (. (TOK_TABLE_OR_COL src1) c1) (. (TOK_TABLE_OR_COL src2) c4))))))) STAGE DEPENDENCIES: - Stage-8 is a root stage , consists of Stage-9, Stage-10, Stage-11, Stage-1 - Stage-9 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-9 - Stage-2 depends on stages: Stage-1, Stage-5, Stage-6, Stage-7 - Stage-10 has a backup stage: Stage-1 - Stage-6 depends on stages: Stage-10 - Stage-11 has a backup stage: Stage-1 - Stage-7 depends on stages: Stage-11 - Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-8 - Conditional Operator - - Stage: Stage-9 + Stage: Stage-6 Map Reduce Local Work Alias -> Map Local Tables: - src2:src + src1:src Fetch Operator limit: -1 src3:src Fetch Operator limit: -1 Alias -> Map Local Operator Tree: - src2:src + src1:src TableScan alias: src Filter Operator predicate: - expr: ((key < 100.0) and (key < 80.0)) + expr: ((key < 80.0) and (key < 100.0)) type: boolean Select Operator expressions: expr: key type: string - expr: value - type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col0 HashTable Sink Operator condition expressions: 0 {_col0} @@ -73,7 +62,7 @@ 0 [Column[_col0]] 1 [Column[_col0]] 2 [Column[_col0]] - Position of Big Table: 0 + Position of Big Table: 1 src3:src TableScan alias: src @@ -96,23 +85,25 @@ 0 [Column[_col0]] 1 [Column[_col0]] 2 [Column[_col0]] - Position of Big Table: 0 + Position of Big Table: 1 Stage: Stage-5 Map Reduce Alias -> Map Operator Tree: - src1:src + src2:src TableScan alias: src Filter Operator predicate: - expr: ((key < 80.0) and (key < 100.0)) + expr: ((key < 100.0) and (key < 80.0)) type: boolean Select Operator expressions: expr: key type: string - outputColumnNames: _col0 + expr: value + type: string + outputColumnNames: _col0, _col1 Map Join Operator condition map: Inner Join 0 to 1 @@ -127,7 +118,7 @@ 1 [Column[_col0]] 2 [Column[_col0]] outputColumnNames: _col0, _col3 - Position of Big Table: 0 + Position of Big Table: 1 Select Operator expressions: expr: _col0 @@ -179,333 +170,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-10 - Map Reduce Local Work - Alias -> Map Local Tables: - src1:src - Fetch Operator - limit: -1 - src3:src - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src1:src - TableScan - alias: src - Filter Operator - predicate: - expr: ((key < 80.0) and (key < 100.0)) - type: boolean - Select Operator - expressions: - expr: key - type: string - outputColumnNames: _col0 - HashTable Sink Operator - condition expressions: - 0 {_col0} - 1 {_col1} - 2 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - 2 [Column[_col0]] - Position of Big Table: 1 - src3:src - TableScan - alias: src - Filter Operator - predicate: - expr: ((key < 100.0) and (key < 80.0)) - type: boolean - Select Operator - expressions: - expr: key - type: string - outputColumnNames: _col0 - HashTable Sink Operator - condition expressions: - 0 {_col0} - 1 {_col1} - 2 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - 2 [Column[_col0]] - Position of Big Table: 1 - - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - src2:src - TableScan - alias: src - Filter Operator - predicate: - expr: ((key < 100.0) and (key < 80.0)) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Map Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {_col0} - 1 {_col1} - 2 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - 2 [Column[_col0]] - outputColumnNames: _col0, _col3 - Position of Big Table: 1 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col3 - type: string - outputColumnNames: _col0, _col3 - Group By Operator - aggregations: - expr: sum(hash(_col0,_col3)) - bucketGroup: false - mode: hash - 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 - Local Work: - Map Reduce Local Work - - Stage: Stage-11 - Map Reduce Local Work - Alias -> Map Local Tables: - src1:src - Fetch Operator - limit: -1 - src2:src - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src1:src - TableScan - alias: src - Filter Operator - predicate: - expr: ((key < 80.0) and (key < 100.0)) - type: boolean - Select Operator - expressions: - expr: key - type: string - outputColumnNames: _col0 - HashTable Sink Operator - condition expressions: - 0 {_col0} - 1 {_col1} - 2 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - 2 [Column[_col0]] - Position of Big Table: 2 - src2:src - TableScan - alias: src - Filter Operator - predicate: - expr: ((key < 100.0) and (key < 80.0)) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - HashTable Sink Operator - condition expressions: - 0 {_col0} - 1 {_col1} - 2 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - 2 [Column[_col0]] - Position of Big Table: 2 - - Stage: Stage-7 - Map Reduce - Alias -> Map Operator Tree: - src3:src - TableScan - alias: src - Filter Operator - predicate: - expr: ((key < 100.0) and (key < 80.0)) - type: boolean - Select Operator - expressions: - expr: key - type: string - outputColumnNames: _col0 - Map Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {_col0} - 1 {_col1} - 2 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - 2 [Column[_col0]] - outputColumnNames: _col0, _col3 - Position of Big Table: 2 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col3 - type: string - outputColumnNames: _col0, _col3 - Group By Operator - aggregations: - expr: sum(hash(_col0,_col3)) - bucketGroup: false - mode: hash - 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 - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1:src - TableScan - alias: src - Filter Operator - predicate: - expr: ((key < 80.0) and (key < 100.0)) - type: boolean - 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 - src2:src - TableScan - alias: src - Filter Operator - predicate: - expr: ((key < 100.0) and (key < 80.0)) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Reduce Output Operator - key expressions: - expr: _col0 - type: string - sort order: + - Map-reduce partition columns: - expr: _col0 - type: string - tag: 1 - value expressions: - expr: _col1 - type: string - src3:src - TableScan - alias: src - Filter Operator - predicate: - expr: ((key < 100.0) and (key < 80.0)) - type: boolean - 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: 2 - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {VALUE._col0} - 1 {VALUE._col1} - 2 - handleSkewJoin: false - outputColumnNames: _col0, _col3 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col3 - type: string - outputColumnNames: _col0, _col3 - Group By Operator - aggregations: - expr: sum(hash(_col0,_col3)) - bucketGroup: false - mode: hash - 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-0 Fetch Operator limit: -1 Index: ql/src/test/results/clientpositive/join41.q.out =================================================================== --- ql/src/test/results/clientpositive/join41.q.out (revision 0) +++ ql/src/test/results/clientpositive/join41.q.out (working copy) @@ -0,0 +1,205 @@ +PREHOOK: query: create table s1 as select * from src where key = 0 +PREHOOK: type: CREATETABLE_AS_SELECT +PREHOOK: Input: default@src +POSTHOOK: query: create table s1 as select * from src where key = 0 +POSTHOOK: type: CREATETABLE_AS_SELECT +POSTHOOK: Input: default@src +POSTHOOK: Output: default@s1 +PREHOOK: query: EXPLAIN +SELECT * FROM s1 src1 LEFT OUTER JOIN s1 src2 ON (src1.key = src2.key AND src2.key > 10) +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +SELECT * FROM s1 src1 LEFT OUTER JOIN s1 src2 ON (src1.key = src2.key AND src2.key > 10) +POSTHOOK: type: QUERY +ABSTRACT SYNTAX TREE: + (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_TABREF (TOK_TABNAME s1) src1) (TOK_TABREF (TOK_TABNAME s1) src2) (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (> (. (TOK_TABLE_OR_COL src2) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)))) + +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: + src1 + TableScan + alias: src1 + 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: value + type: string + src2 + TableScan + alias: src2 + Filter Operator + predicate: + expr: (key > 10.0) + 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: value + type: string + Reduce Operator Tree: + Join Operator + condition map: + Left Outer Join0 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.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + + Stage: Stage-0 + Fetch Operator + limit: -1 + + +PREHOOK: query: SELECT * FROM s1 src1 LEFT OUTER JOIN s1 src2 ON (src1.key = src2.key AND src2.key > 10) +PREHOOK: type: QUERY +PREHOOK: Input: default@s1 +#### A masked pattern was here #### +POSTHOOK: query: SELECT * FROM s1 src1 LEFT OUTER JOIN s1 src2 ON (src1.key = src2.key AND src2.key > 10) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@s1 +#### A masked pattern was here #### +0 val_0 NULL NULL +0 val_0 NULL NULL +0 val_0 NULL NULL +PREHOOK: query: -- Make sure the big table is chosen correctly as part of HIVE-4146 +EXPLAIN +SELECT * FROM s1 src1 LEFT OUTER JOIN s1 src2 ON (src1.key = src2.key AND src2.key > 10) +PREHOOK: type: QUERY +POSTHOOK: query: -- Make sure the big table is chosen correctly as part of HIVE-4146 +EXPLAIN +SELECT * FROM s1 src1 LEFT OUTER JOIN s1 src2 ON (src1.key = src2.key AND src2.key > 10) +POSTHOOK: type: QUERY +ABSTRACT SYNTAX TREE: + (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_TABREF (TOK_TABNAME s1) src1) (TOK_TABREF (TOK_TABNAME s1) src2) (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (> (. (TOK_TABLE_OR_COL src2) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)))) + +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: + src1 + TableScan + alias: src1 + 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: value + type: string + src2 + TableScan + alias: src2 + Filter Operator + predicate: + expr: (key > 10.0) + 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: value + type: string + Reduce Operator Tree: + Join Operator + condition map: + Left Outer Join0 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.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + + Stage: Stage-0 + Fetch Operator + limit: -1 + + +PREHOOK: query: SELECT * FROM s1 src1 LEFT OUTER JOIN s1 src2 ON (src1.key = src2.key AND src2.key > 10) +PREHOOK: type: QUERY +PREHOOK: Input: default@s1 +#### A masked pattern was here #### +POSTHOOK: query: SELECT * FROM s1 src1 LEFT OUTER JOIN s1 src2 ON (src1.key = src2.key AND src2.key > 10) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@s1 +#### A masked pattern was here #### +0 val_0 NULL NULL +0 val_0 NULL NULL +0 val_0 NULL NULL Index: ql/src/test/results/clientpositive/auto_join28.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join28.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join28.q.out (working copy) @@ -8,35 +8,40 @@ (TOK_QUERY (TOK_FROM (TOK_RIGHTOUTERJOIN (TOK_LEFTOUTERJOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-1 - Stage-1 - Stage-2 depends on stages: Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: Stage: Stage-6 - Conditional Operator - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: + Map Reduce Local Work + Alias -> Map Local Tables: src1 + Fetch Operator + limit: -1 + src2 + Fetch Operator + limit: -1 + Alias -> Map Local Operator Tree: + src1 TableScan alias: src1 - 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: value - type: string + HashTable Sink Operator + condition expressions: + 0 {key} {value} + 1 {key} {value} + 2 {key} {value} + filter predicates: + 0 {(key < 10.0)} + 1 + 2 {(key < 10.0)} + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + 2 [Column[key]] + Position of Big Table: 2 src2 TableScan alias: src2 @@ -44,73 +49,70 @@ predicate: expr: (key > 10.0) type: boolean - Reduce Output Operator - key expressions: - expr: key + HashTable Sink Operator + condition expressions: + 0 {key} {value} + 1 {key} {value} + 2 {key} {value} + filter predicates: + 0 {(key < 10.0)} + 1 + 2 {(key < 10.0)} + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + 2 [Column[key]] + Position of Big Table: 2 + + Stage: Stage-5 + Map Reduce + Alias -> Map Operator Tree: + src3 + TableScan + alias: src3 + Map Join Operator + condition map: + Left Outer Join0 to 1 + Right Outer Join1 to 2 + condition expressions: + 0 {key} {value} + 1 {key} {value} + 2 {key} {value} + filter predicates: + 0 {(key < 10.0)} + 1 + 2 {(key < 10.0)} + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + 2 [Column[key]] + outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 + Position of Big Table: 2 + Select Operator + expressions: + expr: _col0 type: string - sort order: + - Map-reduce partition columns: - expr: key + expr: _col1 type: string - tag: 1 - value expressions: - expr: key + expr: _col4 type: string - expr: value + expr: _col5 type: string - src3 - TableScan - alias: src3 - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 2 - value expressions: - expr: key - type: string - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Left Outer Join0 to 1 - Right Outer Join1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - filter predicates: - 0 {(VALUE._col0 < 10.0)} - 1 - 2 {(VALUE._col0 < 10.0)} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + expr: _col8 + type: string + expr: _col9 + type: string + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + Local Work: + Map Reduce Local Work Stage: Stage-2 Map Reduce @@ -169,56 +171,44 @@ (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_LEFTOUTERJOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-1 - Stage-1 - Stage-2 depends on stages: Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: Stage: Stage-6 - Conditional Operator - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - 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: value - type: string + Map Reduce Local Work + Alias -> Map Local Tables: src2 + Fetch Operator + limit: -1 + src3 + Fetch Operator + limit: -1 + Alias -> Map Local Operator Tree: + src2 TableScan alias: src2 Filter Operator predicate: expr: (key > 10.0) 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: value - type: string + HashTable Sink Operator + condition expressions: + 0 {key} {value} + 1 {key} {value} + 2 {key} {value} + filter predicates: + 0 {(key < 10.0)} + 1 + 2 + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + 2 [Column[key]] + Position of Big Table: 0 src3 TableScan alias: src3 @@ -226,56 +216,70 @@ predicate: expr: ((key > 10.0) and (key < 10.0)) type: boolean - Reduce Output Operator - key expressions: - expr: key + HashTable Sink Operator + condition expressions: + 0 {key} {value} + 1 {key} {value} + 2 {key} {value} + filter predicates: + 0 {(key < 10.0)} + 1 + 2 + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + 2 [Column[key]] + Position of Big Table: 0 + + Stage: Stage-5 + Map Reduce + Alias -> Map Operator Tree: + src1 + TableScan + alias: src1 + Map Join Operator + condition map: + Left Outer Join0 to 1 + Left Outer Join1 to 2 + condition expressions: + 0 {key} {value} + 1 {key} {value} + 2 {key} {value} + filter predicates: + 0 {(key < 10.0)} + 1 + 2 + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + 2 [Column[key]] + outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 + Position of Big Table: 0 + Select Operator + expressions: + expr: _col0 type: string - sort order: + - Map-reduce partition columns: - expr: key + expr: _col1 type: string - tag: 2 - value expressions: - expr: key + expr: _col4 type: string - expr: value + expr: _col5 type: string - Reduce Operator Tree: - Join Operator - condition map: - Left Outer Join0 to 1 - Left Outer Join1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - filter predicates: - 0 {(VALUE._col0 < 10.0)} - 1 - 2 - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + expr: _col8 + type: string + expr: _col9 + type: string + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + Local Work: + Map Reduce Local Work Stage: Stage-2 Map Reduce @@ -334,56 +338,44 @@ (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_RIGHTOUTERJOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-1 - Stage-1 - Stage-2 depends on stages: Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: Stage: Stage-6 - Conditional Operator - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: + Map Reduce Local Work + Alias -> Map Local Tables: src1 + Fetch Operator + limit: -1 + src3 + Fetch Operator + limit: -1 + Alias -> Map Local Operator Tree: + src1 TableScan alias: src1 Filter Operator predicate: expr: (key < 10.0) 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: value - type: string - src2 - TableScan - alias: src2 - 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: value - type: string + HashTable Sink Operator + condition expressions: + 0 {key} {value} + 1 {key} {value} + 2 {key} {value} + filter predicates: + 0 + 1 {(key > 10.0)} + 2 + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + 2 [Column[key]] + Position of Big Table: 1 src3 TableScan alias: src3 @@ -391,56 +383,70 @@ predicate: expr: (key < 10.0) type: boolean - Reduce Output Operator - key expressions: - expr: key + HashTable Sink Operator + condition expressions: + 0 {key} {value} + 1 {key} {value} + 2 {key} {value} + filter predicates: + 0 + 1 {(key > 10.0)} + 2 + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + 2 [Column[key]] + Position of Big Table: 1 + + Stage: Stage-5 + Map Reduce + Alias -> Map Operator Tree: + src2 + TableScan + alias: src2 + Map Join Operator + condition map: + Right Outer Join0 to 1 + Left Outer Join1 to 2 + condition expressions: + 0 {key} {value} + 1 {key} {value} + 2 {key} {value} + filter predicates: + 0 + 1 {(key > 10.0)} + 2 + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + 2 [Column[key]] + outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 + Position of Big Table: 1 + Select Operator + expressions: + expr: _col0 type: string - sort order: + - Map-reduce partition columns: - expr: key + expr: _col1 type: string - tag: 2 - value expressions: - expr: key + expr: _col4 type: string - expr: value + expr: _col5 type: string - Reduce Operator Tree: - Join Operator - condition map: - Right Outer Join0 to 1 - Left Outer Join1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - filter predicates: - 0 - 1 {(VALUE._col0 > 10.0)} - 2 - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + expr: _col8 + type: string + expr: _col9 + type: string + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + Local Work: + Map Reduce Local Work Stage: Stage-2 Map Reduce @@ -499,109 +505,111 @@ (TOK_QUERY (TOK_FROM (TOK_RIGHTOUTERJOIN (TOK_RIGHTOUTERJOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 10)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-1 - Stage-1 - Stage-2 depends on stages: Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: Stage: Stage-6 - Conditional Operator - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: + Map Reduce Local Work + Alias -> Map Local Tables: src1 + Fetch Operator + limit: -1 + src2 + Fetch Operator + limit: -1 + Alias -> Map Local Operator Tree: + src1 TableScan alias: src1 Filter Operator predicate: expr: (key < 10.0) 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: value - type: string + HashTable Sink Operator + condition expressions: + 0 {key} {value} + 1 {key} {value} + 2 {key} {value} + filter predicates: + 0 + 1 {(key > 10.0)} + 2 {(key < 10.0)} + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + 2 [Column[key]] + Position of Big Table: 2 src2 TableScan alias: src2 - 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: value - type: string + HashTable Sink Operator + condition expressions: + 0 {key} {value} + 1 {key} {value} + 2 {key} {value} + filter predicates: + 0 + 1 {(key > 10.0)} + 2 {(key < 10.0)} + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + 2 [Column[key]] + Position of Big Table: 2 + + Stage: Stage-5 + Map Reduce + Alias -> Map Operator Tree: src3 TableScan alias: src3 - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 2 - value expressions: - expr: key - type: string - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Right Outer Join0 to 1 - Right Outer Join1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - filter predicates: - 0 - 1 {(VALUE._col0 > 10.0)} - 2 {(VALUE._col0 < 10.0)} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + Map Join Operator + condition map: + Right Outer Join0 to 1 + Right Outer Join1 to 2 + condition expressions: + 0 {key} {value} + 1 {key} {value} + 2 {key} {value} + filter predicates: + 0 + 1 {(key > 10.0)} + 2 {(key < 10.0)} + handleSkewJoin: false + keys: + 0 [Column[key]] + 1 [Column[key]] + 2 [Column[key]] + outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 + Position of Big Table: 2 + Select Operator + expressions: + expr: _col0 + type: string + expr: _col1 + type: string + expr: _col4 + type: string + expr: _col5 + type: string + expr: _col8 + type: string + expr: _col9 + type: string + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + File Output Operator + compressed: false + GlobalTableId: 0 + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + Local Work: + Map Reduce Local Work Stage: Stage-2 Map Reduce Index: ql/src/test/results/clientpositive/auto_join5.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join5.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join5.q.out (working copy) @@ -37,18 +37,13 @@ (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_RIGHTOUTERJOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src) src1)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src1) key) c1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src1) value) c2)) (TOK_WHERE (and (> (. (TOK_TABLE_OR_COL src1) key) 10) (< (. (TOK_TABLE_OR_COL src1) key) 20))))) a) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src) src2)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src2) key) c3) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src2) value) c4)) (TOK_WHERE (and (> (. (TOK_TABLE_OR_COL src2) key) 15) (< (. (TOK_TABLE_OR_COL src2) key) 25))))) b) (= (. (TOK_TABLE_OR_COL a) c1) (. (TOK_TABLE_OR_COL b) c3)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) c1) c1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) c2) c2) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) c3) c3) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) c4) c4)))) c)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL c) c1)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL c) c2)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL c) c3)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL c) c4))))) STAGE DEPENDENCIES: - Stage-5 is a root stage , consists of Stage-6, Stage-1 - Stage-6 has a backup stage: Stage-1 - Stage-4 depends on stages: Stage-6 - Stage-0 depends on stages: Stage-1, Stage-4 + Stage-5 is a root stage + Stage-4 depends on stages: Stage-5 + Stage-0 depends on stages: Stage-4 Stage-2 depends on stages: Stage-0 - Stage-1 STAGE PLANS: Stage: Stage-5 - Conditional Operator - - Stage: Stage-6 Map Reduce Local Work Alias -> Map Local Tables: c:a:src1 @@ -143,95 +138,7 @@ Stage: Stage-2 Stats-Aggr Operator - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - c:a:src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 20.0)) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - 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 - expr: _col1 - type: string - c:b:src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: ((key > 15.0) and (key < 25.0)) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Reduce Output Operator - key expressions: - expr: _col0 - type: string - sort order: + - Map-reduce partition columns: - expr: _col0 - type: string - tag: 1 - value expressions: - expr: _col0 - type: string - expr: _col1 - type: string - Reduce Operator Tree: - Join Operator - condition map: - Right Outer Join0 to 1 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col2, _col3 - Select Operator - expressions: - expr: UDFToInteger(_col0) - type: int - expr: _col1 - type: string - expr: UDFToInteger(_col2) - type: int - expr: _col3 - type: string - outputColumnNames: _col0, _col1, _col2, _col3 - File Output Operator - compressed: false - GlobalTableId: 1 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.dest1 - PREHOOK: query: FROM ( FROM ( Index: ql/src/test/results/clientpositive/auto_join0.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join0.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join0.q.out (working copy) @@ -24,21 +24,14 @@ (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_WHERE (< (. (TOK_TABLE_OR_COL src) key) 10)))) src1) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_WHERE (< (. (TOK_TABLE_OR_COL src) key) 10)))) src2))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src1) key) k1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src1) value) v1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src2) key) k2) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src2) value) v2)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (TOK_TABLE_OR_COL k1)) (TOK_TABSORTCOLNAMEASC (TOK_TABLE_OR_COL v1)) (TOK_TABSORTCOLNAMEASC (TOK_TABLE_OR_COL k2)) (TOK_TABSORTCOLNAMEASC (TOK_TABLE_OR_COL v2))))) a)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION hash (. (TOK_TABLE_OR_COL a) k1) (. (TOK_TABLE_OR_COL a) v1) (. (TOK_TABLE_OR_COL a) k2) (. (TOK_TABLE_OR_COL a) v2))))))) STAGE DEPENDENCIES: - Stage-7 is a root stage , consists of Stage-8, Stage-9, Stage-1 - Stage-8 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-8 - Stage-2 depends on stages: Stage-1, Stage-5, Stage-6 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-3 depends on stages: Stage-2 - Stage-9 has a backup stage: Stage-1 - Stage-6 depends on stages: Stage-9 - Stage-1 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-7 - Conditional Operator - - Stage: Stage-8 + Stage: Stage-6 Map Reduce Local Work Alias -> Map Local Tables: a:src2:src @@ -198,160 +191,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-9 - Map Reduce Local Work - Alias -> Map Local Tables: - a:src1:src - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - a:src1:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 10.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - HashTable Sink Operator - condition expressions: - 0 {_col0} {_col1} - 1 {_col0} {_col1} - handleSkewJoin: false - keys: - 0 [] - 1 [] - Position of Big Table: 1 - - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - a:src2:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 10.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {_col0} {_col1} - 1 {_col0} {_col1} - handleSkewJoin: false - keys: - 0 [] - 1 [] - outputColumnNames: _col0, _col1, _col2, _col3 - Position of Big Table: 1 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col2 - type: string - expr: _col3 - 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 - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - a:src1:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 10.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Reduce Output Operator - sort order: - tag: 0 - value expressions: - expr: _col0 - type: string - expr: _col1 - type: string - a:src2:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 10.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Reduce Output Operator - sort order: - tag: 1 - value expressions: - expr: _col0 - type: string - expr: _col1 - 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, _col2, _col3 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col2 - type: string - expr: _col3 - 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-0 Fetch Operator limit: -1 Index: ql/src/test/results/clientpositive/auto_join11.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join11.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join11.q.out (working copy) @@ -18,27 +18,20 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) key) c1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) value) c2)))) src1) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) key) c3) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) value) c4)))) src2) (AND (= (. (TOK_TABLE_OR_COL src1) c1) (. (TOK_TABLE_OR_COL src2) c3)) (< (. (TOK_TABLE_OR_COL src1) c1) 100)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION hash (. (TOK_TABLE_OR_COL src1) c1) (. (TOK_TABLE_OR_COL src2) c4))))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-7, Stage-8, Stage-1 - Stage-7 has a backup stage: Stage-1 - Stage-4 depends on stages: Stage-7 - Stage-2 depends on stages: Stage-1, Stage-4, Stage-5 - Stage-8 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-8 - Stage-1 + Stage-5 is a root stage + Stage-4 depends on stages: Stage-5 + Stage-2 depends on stages: Stage-4 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-6 - Conditional Operator - - Stage: Stage-7 + Stage: Stage-5 Map Reduce Local Work Alias -> Map Local Tables: - src2:src + src1:src Fetch Operator limit: -1 Alias -> Map Local Operator Tree: - src2:src + src1:src TableScan alias: src Filter Operator @@ -49,9 +42,7 @@ expressions: expr: key type: string - expr: value - type: string - outputColumnNames: _col0, _col1 + outputColumnNames: _col0 HashTable Sink Operator condition expressions: 0 {_col0} @@ -60,12 +51,12 @@ keys: 0 [Column[_col0]] 1 [Column[_col0]] - Position of Big Table: 0 + Position of Big Table: 1 Stage: Stage-4 Map Reduce Alias -> Map Operator Tree: - src1:src + src2:src TableScan alias: src Filter Operator @@ -76,7 +67,9 @@ expressions: expr: key type: string - outputColumnNames: _col0 + expr: value + type: string + outputColumnNames: _col0, _col1 Map Join Operator condition map: Inner Join 0 to 1 @@ -88,7 +81,7 @@ 0 [Column[_col0]] 1 [Column[_col0]] outputColumnNames: _col0, _col3 - Position of Big Table: 0 + Position of Big Table: 1 Select Operator expressions: expr: _col0 @@ -140,168 +133,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-8 - Map Reduce Local Work - Alias -> Map Local Tables: - src1:src - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src1:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 100.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - outputColumnNames: _col0 - HashTable Sink Operator - condition expressions: - 0 {_col0} - 1 {_col1} - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 1 - - Stage: Stage-5 - Map Reduce - Alias -> Map Operator Tree: - src2:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 100.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {_col0} - 1 {_col1} - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - outputColumnNames: _col0, _col3 - Position of Big Table: 1 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col3 - type: string - outputColumnNames: _col0, _col3 - Group By Operator - aggregations: - expr: sum(hash(_col0,_col3)) - bucketGroup: false - mode: hash - 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 - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 100.0) - type: boolean - 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 - src2:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 100.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Reduce Output Operator - key expressions: - expr: _col0 - type: string - sort order: + - Map-reduce partition columns: - expr: _col0 - type: string - tag: 1 - value expressions: - expr: _col1 - type: string - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {VALUE._col0} - 1 {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col0, _col3 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col3 - type: string - outputColumnNames: _col0, _col3 - Group By Operator - aggregations: - expr: sum(hash(_col0,_col3)) - bucketGroup: false - mode: hash - 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-0 Fetch Operator limit: -1 Index: ql/src/test/results/clientpositive/multiMapJoin1.q.out =================================================================== --- ql/src/test/results/clientpositive/multiMapJoin1.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/multiMapJoin1.q.out (working copy) @@ -129,31 +129,21 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME bigTbl)) (TOK_TABREF (TOK_TABNAME smallTbl1)) (= (. (TOK_TABLE_OR_COL bigTbl) key) (. (TOK_TABLE_OR_COL smallTbl1) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL bigTbl) key) key) (TOK_SELEXPR (. (TOK_TABLE_OR_COL bigTbl) value) value1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL bigTbl) value) value2)))) firstjoin) (TOK_TABREF (TOK_TABNAME smallTbl2)) (= (. (TOK_TABLE_OR_COL firstjoin) value1) (. (TOK_TABLE_OR_COL smallTbl2) value)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTIONSTAR count))))) STAGE DEPENDENCIES: - Stage-10 is a root stage , consists of Stage-13, Stage-14, Stage-3 - Stage-13 has a backup stage: Stage-3 - Stage-8 depends on stages: Stage-13 - Stage-7 depends on stages: Stage-3, Stage-8, Stage-9 , consists of Stage-11, Stage-12, Stage-1 - Stage-11 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-11 - Stage-2 depends on stages: Stage-1, Stage-5, Stage-6 - Stage-12 has a backup stage: Stage-1 - Stage-6 depends on stages: Stage-12 - Stage-1 - Stage-14 has a backup stage: Stage-3 - Stage-9 depends on stages: Stage-14 - Stage-3 + Stage-7 is a root stage + Stage-6 depends on stages: Stage-7 + Stage-2 depends on stages: Stage-6 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-10 - Conditional Operator - - Stage: Stage-13 + Stage: Stage-7 Map Reduce Local Work Alias -> Map Local Tables: firstjoin:smalltbl1 Fetch Operator limit: -1 + smalltbl2 + Fetch Operator + limit: -1 Alias -> Map Local Operator Tree: firstjoin:smalltbl1 TableScan @@ -167,50 +157,7 @@ 0 [Column[key]] 1 [Column[key]] Position of Big Table: 0 - - Stage: Stage-8 - Map Reduce - Alias -> Map Operator Tree: - firstjoin:bigtbl - TableScan - alias: bigtbl - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {value} - 1 - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - outputColumnNames: _col1 - Position of Big Table: 0 - Select Operator - expressions: - expr: _col1 - type: string - outputColumnNames: _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 - Local Work: - Map Reduce Local Work - - Stage: Stage-7 - Conditional Operator - - Stage: Stage-11 - Map Reduce Local Work - Alias -> Map Local Tables: smalltbl2 - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - smalltbl2 TableScan alias: smalltbl2 HashTable Sink Operator @@ -223,34 +170,53 @@ 1 [Column[value]] Position of Big Table: 0 - Stage: Stage-5 + Stage: Stage-6 Map Reduce Alias -> Map Operator Tree: - $INTNAME + firstjoin:bigtbl + TableScan + alias: bigtbl Map Join Operator condition map: Inner Join 0 to 1 condition expressions: - 0 + 0 {value} 1 handleSkewJoin: false keys: - 0 [Column[_col1]] - 1 [Column[value]] + 0 [Column[key]] + 1 [Column[key]] + outputColumnNames: _col1 Position of Big Table: 0 Select Operator - Group By Operator - aggregations: - expr: count() - bucketGroup: false - mode: hash - 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 + expressions: + expr: _col1 + type: string + outputColumnNames: _col1 + Map Join Operator + condition map: + Inner Join 0 to 1 + condition expressions: + 0 + 1 + handleSkewJoin: false + keys: + 0 [Column[_col1]] + 1 [Column[value]] + Position of Big Table: 0 + Select Operator + Group By Operator + aggregations: + expr: count() + bucketGroup: false + mode: hash + 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 Local Work: Map Reduce Local Work @@ -283,207 +249,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-12 - Map Reduce Local Work - Alias -> Map Local Tables: - $INTNAME - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - $INTNAME - HashTable Sink Operator - condition expressions: - 0 - 1 - handleSkewJoin: false - keys: - 0 [Column[_col1]] - 1 [Column[value]] - Position of Big Table: 1 - - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - smalltbl2 - TableScan - alias: smalltbl2 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 - 1 - handleSkewJoin: false - keys: - 0 [Column[_col1]] - 1 [Column[value]] - Position of Big Table: 1 - Select Operator - Group By Operator - aggregations: - expr: count() - bucketGroup: false - mode: hash - 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 - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - $INTNAME - Reduce Output Operator - key expressions: - expr: _col1 - type: string - sort order: + - Map-reduce partition columns: - expr: _col1 - type: string - tag: 0 - smalltbl2 - TableScan - alias: smalltbl2 - Reduce Output Operator - key expressions: - expr: value - type: string - sort order: + - Map-reduce partition columns: - expr: value - type: string - tag: 1 - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 - 1 - handleSkewJoin: false - Select Operator - Group By Operator - aggregations: - expr: count() - bucketGroup: false - mode: hash - 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-14 - Map Reduce Local Work - Alias -> Map Local Tables: - firstjoin:bigtbl - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - firstjoin:bigtbl - TableScan - alias: bigtbl - HashTable Sink Operator - condition expressions: - 0 {value} - 1 - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - Position of Big Table: 1 - - Stage: Stage-9 - Map Reduce - Alias -> Map Operator Tree: - firstjoin:smalltbl1 - TableScan - alias: smalltbl1 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {value} - 1 - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - outputColumnNames: _col1 - Position of Big Table: 1 - Select Operator - expressions: - expr: _col1 - type: string - outputColumnNames: _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 - Local Work: - Map Reduce Local Work - - Stage: Stage-3 - Map Reduce - Alias -> Map Operator Tree: - firstjoin:bigtbl - TableScan - alias: bigtbl - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 0 - value expressions: - expr: value - type: string - firstjoin:smalltbl1 - TableScan - alias: smalltbl1 - 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._col1} - 1 - handleSkewJoin: false - outputColumnNames: _col1 - Select Operator - expressions: - expr: _col1 - type: string - outputColumnNames: _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 Index: ql/src/test/results/clientpositive/auto_join27.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join27.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join27.q.out (working copy) @@ -27,13 +27,9 @@ STAGE DEPENDENCIES: Stage-1 is a root stage - Stage-8 depends on stages: Stage-1 , consists of Stage-9, Stage-10, Stage-2 - Stage-9 has a backup stage: Stage-2 - Stage-6 depends on stages: Stage-9 - Stage-3 depends on stages: Stage-2, Stage-6, Stage-7 - Stage-10 has a backup stage: Stage-2 - Stage-7 depends on stages: Stage-10 - Stage-2 + Stage-7 depends on stages: Stage-1 + Stage-6 depends on stages: Stage-7 + Stage-3 depends on stages: Stage-6 Stage-0 is a root stage STAGE PLANS: @@ -100,10 +96,7 @@ input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - Stage: Stage-8 - Conditional Operator - - Stage: Stage-9 + Stage: Stage-7 Map Reduce Local Work Alias -> Map Local Tables: src3:src @@ -233,177 +226,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-10 - Map Reduce Local Work - Alias -> Map Local Tables: -#### A masked pattern was here #### - Fetch Operator - limit: -1 - null-subquery1:src_12-subquery1:src - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: -#### A masked pattern was here #### - TableScan - Union - HashTable Sink Operator - condition expressions: - 0 - 1 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 1 - null-subquery1:src_12-subquery1:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 200.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Union - HashTable Sink Operator - condition expressions: - 0 - 1 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 1 - - Stage: Stage-7 - Map Reduce - Alias -> Map Operator Tree: - src3:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 200.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - outputColumnNames: _col0 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 - 1 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 1 - Select Operator - Group By Operator - aggregations: - expr: count(1) - bucketGroup: false - mode: hash - 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 - Local Work: - Map Reduce Local Work - - Stage: Stage-2 - Map Reduce - Alias -> Map Operator Tree: -#### A masked pattern was here #### - TableScan - Union - Reduce Output Operator - key expressions: - expr: _col0 - type: string - sort order: + - Map-reduce partition columns: - expr: _col0 - type: string - tag: 0 - null-subquery1:src_12-subquery1:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 200.0) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Union - Reduce Output Operator - key expressions: - expr: _col0 - type: string - sort order: + - Map-reduce partition columns: - expr: _col0 - type: string - tag: 0 - src3:src - TableScan - alias: src - Filter Operator - predicate: - expr: (key < 200.0) - type: boolean - 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 - 1 - handleSkewJoin: false - Select Operator - Group By Operator - aggregations: - expr: count(1) - bucketGroup: false - mode: hash - 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-0 Fetch Operator limit: -1 Index: ql/src/test/results/clientpositive/mapjoin_filter_on_outerjoin.q.out =================================================================== --- ql/src/test/results/clientpositive/mapjoin_filter_on_outerjoin.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/mapjoin_filter_on_outerjoin.q.out (working copy) @@ -253,26 +253,19 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_RIGHTOUTERJOIN (TOK_TABREF (TOK_TABNAME src1)) (TOK_TABREF (TOK_TABNAME src1) src2) (AND (AND (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (< (. (TOK_TABLE_OR_COL src1) key) 10)) (> (. (TOK_TABLE_OR_COL src2) key) 10))) (TOK_TABREF (TOK_TABNAME src) src3) (AND (= (. (TOK_TABLE_OR_COL src2) key) (. (TOK_TABLE_OR_COL src3) key)) (< (. (TOK_TABLE_OR_COL src3) key) 300)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_SORTBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src1) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src2) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL src3) key))))) STAGE DEPENDENCIES: - Stage-7 is a root stage , consists of Stage-8, Stage-9, Stage-1 - Stage-8 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-8 - Stage-2 depends on stages: Stage-1, Stage-5, Stage-6 - Stage-9 has a backup stage: Stage-1 - Stage-6 depends on stages: Stage-9 - Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-7 - Conditional Operator - - Stage: Stage-8 + Stage: Stage-6 Map Reduce Local Work Alias -> Map Local Tables: src1 Fetch Operator limit: -1 - src3 + src2 Fetch Operator limit: -1 Alias -> Map Local Operator Tree: @@ -297,10 +290,10 @@ 0 [Column[key]] 1 [Column[key]] 2 [Column[key]] - Position of Big Table: 1 - src3 + Position of Big Table: 2 + src2 TableScan - alias: src3 + alias: src2 Filter Operator predicate: expr: (key < 300.0) @@ -319,14 +312,14 @@ 0 [Column[key]] 1 [Column[key]] 2 [Column[key]] - Position of Big Table: 1 + Position of Big Table: 2 Stage: Stage-5 Map Reduce Alias -> Map Operator Tree: - src2 + src3 TableScan - alias: src2 + alias: src3 Filter Operator predicate: expr: (key < 300.0) @@ -349,7 +342,7 @@ 1 [Column[key]] 2 [Column[key]] outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 1 + Position of Big Table: 2 Select Operator expressions: expr: _col0 @@ -410,217 +403,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-9 - Map Reduce Local Work - Alias -> Map Local Tables: - src1 - Fetch Operator - limit: -1 - src2 - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: ((key < 300.0) and (key < 10.0)) - type: boolean - HashTable Sink Operator - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - filter predicates: - 0 - 1 {(key > 10.0)} - 2 - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 2 - src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: (key < 300.0) - type: boolean - HashTable Sink Operator - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - filter predicates: - 0 - 1 {(key > 10.0)} - 2 - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 2 - - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - src3 - TableScan - alias: src3 - Filter Operator - predicate: - expr: (key < 300.0) - type: boolean - Map Join Operator - condition map: - Right Outer Join0 to 1 - Inner Join 1 to 2 - condition expressions: - 0 {key} {value} - 1 {key} {value} - 2 {key} {value} - filter predicates: - 0 - 1 {(key > 10.0)} - 2 - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 2 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: ((key < 300.0) and (key < 10.0)) - 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: value - type: string - src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: (key < 300.0) - 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: value - type: string - src3 - TableScan - alias: src3 - Filter Operator - predicate: - expr: (key < 300.0) - type: boolean - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 2 - value expressions: - expr: key - type: string - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Right Outer Join0 to 1 - Inner Join 1 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - filter predicates: - 0 - 1 {(VALUE._col0 > 10.0)} - 2 - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - type: string - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 - 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 Index: ql/src/test/results/clientpositive/auto_join9.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join9.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join9.q.out (working copy) @@ -15,29 +15,22 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME srcpart) src1) (TOK_TABREF (TOK_TABNAME src) src2) (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src1) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src2) value))) (TOK_WHERE (and (= (. (TOK_TABLE_OR_COL src1) ds) '2008-04-08') (= (. (TOK_TABLE_OR_COL src1) hr) '12'))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-7, Stage-8, Stage-1 - Stage-7 has a backup stage: Stage-1 - Stage-4 depends on stages: Stage-7 - Stage-0 depends on stages: Stage-1, Stage-4, Stage-5 + Stage-5 is a root stage + Stage-4 depends on stages: Stage-5 + Stage-0 depends on stages: Stage-4 Stage-2 depends on stages: Stage-0 - Stage-8 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-8 - Stage-1 STAGE PLANS: - Stage: Stage-6 - Conditional Operator - - Stage: Stage-7 + Stage: Stage-5 Map Reduce Local Work Alias -> Map Local Tables: - src2 + src1 Fetch Operator limit: -1 Alias -> Map Local Operator Tree: - src2 + src1 TableScan - alias: src2 + alias: src1 HashTable Sink Operator condition expressions: 0 {key} @@ -46,14 +39,14 @@ keys: 0 [Column[key]] 1 [Column[key]] - Position of Big Table: 0 + Position of Big Table: 1 Stage: Stage-4 Map Reduce Alias -> Map Operator Tree: - src1 + src2 TableScan - alias: src1 + alias: src2 Map Join Operator condition map: Inner Join 0 to 1 @@ -65,7 +58,7 @@ 0 [Column[key]] 1 [Column[key]] outputColumnNames: _col0, _col7 - Position of Big Table: 0 + Position of Big Table: 1 Select Operator expressions: expr: UDFToInteger(_col0) @@ -97,120 +90,7 @@ Stage: Stage-2 Stats-Aggr Operator - Stage: Stage-8 - Map Reduce Local Work - Alias -> Map Local Tables: - src1 - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src1 - TableScan - alias: src1 - HashTable Sink Operator - condition expressions: - 0 {key} - 1 {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - Position of Big Table: 1 - Stage: Stage-5 - Map Reduce - Alias -> Map Operator Tree: - src2 - TableScan - alias: src2 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {key} - 1 {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - outputColumnNames: _col0, _col7 - Position of Big Table: 1 - Select Operator - expressions: - expr: UDFToInteger(_col0) - type: int - expr: _col7 - type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 1 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.dest1 - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - 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 - src2 - TableScan - alias: src2 - 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: string - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {VALUE._col0} - 1 {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col0, _col7 - Select Operator - expressions: - expr: UDFToInteger(_col0) - type: int - expr: _col7 - type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 1 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.dest1 - PREHOOK: query: FROM srcpart src1 JOIN src src2 ON (src1.key = src2.key) INSERT OVERWRITE TABLE dest1 SELECT src1.key, src2.value where src1.ds = '2008-04-08' and src1.hr = '12' PREHOOK: type: QUERY Index: ql/src/test/results/clientpositive/auto_sortmerge_join_9.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_sortmerge_join_9.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_sortmerge_join_9.q.out (working copy) @@ -1459,20 +1459,13 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME tbl1) a)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (+ (. (TOK_TABLE_OR_COL a) key) 1) key) (TOK_SELEXPR (TOK_FUNCTION concat (. (TOK_TABLE_OR_COL a) value) (. (TOK_TABLE_OR_COL a) value)) value)))) subq1) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME tbl2) a)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (+ (. (TOK_TABLE_OR_COL a) key) 1) key) (TOK_SELEXPR (TOK_FUNCTION concat (. (TOK_TABLE_OR_COL a) value) (. (TOK_TABLE_OR_COL a) value)) value)))) 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_FUNCTIONSTAR count))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-7, Stage-8, Stage-1 - Stage-7 has a backup stage: Stage-1 - Stage-4 depends on stages: Stage-7 - Stage-2 depends on stages: Stage-1, Stage-4, Stage-5 - Stage-8 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-8 - Stage-1 + Stage-5 is a root stage + Stage-4 depends on stages: Stage-5 + Stage-2 depends on stages: Stage-4 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-6 - Conditional Operator - - Stage: Stage-7 + Stage: Stage-5 Map Reduce Local Work Alias -> Map Local Tables: subq2:a @@ -1564,128 +1557,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-8 - Map Reduce Local Work - Alias -> Map Local Tables: - subq1:a - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - subq1:a - TableScan - alias: a - Select Operator - expressions: - expr: (key + 1) - type: int - outputColumnNames: _col0 - HashTable Sink Operator - condition expressions: - 0 - 1 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 1 - - Stage: Stage-5 - Map Reduce - Alias -> Map Operator Tree: - subq2:a - TableScan - alias: a - Select Operator - expressions: - expr: (key + 1) - type: int - outputColumnNames: _col0 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 - 1 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 1 - Select Operator - Group By Operator - aggregations: - expr: count() - bucketGroup: false - mode: hash - 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 - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - subq1:a - TableScan - alias: a - Select Operator - expressions: - expr: (key + 1) - type: int - outputColumnNames: _col0 - Reduce Output Operator - key expressions: - expr: _col0 - type: int - sort order: + - Map-reduce partition columns: - expr: _col0 - type: int - tag: 0 - subq2:a - TableScan - alias: a - Select Operator - expressions: - expr: (key + 1) - type: int - outputColumnNames: _col0 - Reduce Output Operator - key expressions: - expr: _col0 - type: int - sort order: + - Map-reduce partition columns: - expr: _col0 - type: int - tag: 1 - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 - 1 - handleSkewJoin: false - Select Operator - Group By Operator - aggregations: - expr: count() - bucketGroup: false - mode: hash - 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-0 Fetch Operator limit: -1 Index: ql/src/test/results/clientpositive/auto_join4.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join4.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join4.q.out (working copy) @@ -37,18 +37,13 @@ (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src) src1)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src1) key) c1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src1) value) c2)) (TOK_WHERE (and (> (. (TOK_TABLE_OR_COL src1) key) 10) (< (. (TOK_TABLE_OR_COL src1) key) 20))))) a) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src) src2)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src2) key) c3) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src2) value) c4)) (TOK_WHERE (and (> (. (TOK_TABLE_OR_COL src2) key) 15) (< (. (TOK_TABLE_OR_COL src2) key) 25))))) b) (= (. (TOK_TABLE_OR_COL a) c1) (. (TOK_TABLE_OR_COL b) c3)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) c1) c1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) c2) c2) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) c3) c3) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) c4) c4)))) c)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL c) c1)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL c) c2)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL c) c3)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL c) c4))))) STAGE DEPENDENCIES: - Stage-5 is a root stage , consists of Stage-6, Stage-1 - Stage-6 has a backup stage: Stage-1 - Stage-4 depends on stages: Stage-6 - Stage-0 depends on stages: Stage-1, Stage-4 + Stage-5 is a root stage + Stage-4 depends on stages: Stage-5 + Stage-0 depends on stages: Stage-4 Stage-2 depends on stages: Stage-0 - Stage-1 STAGE PLANS: Stage: Stage-5 - Conditional Operator - - Stage: Stage-6 Map Reduce Local Work Alias -> Map Local Tables: c:b:src2 @@ -143,95 +138,7 @@ Stage: Stage-2 Stats-Aggr Operator - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - c:a:src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: ((key > 10.0) and (key < 20.0)) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - 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 - expr: _col1 - type: string - c:b:src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: ((key > 15.0) and (key < 25.0)) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Reduce Output Operator - key expressions: - expr: _col0 - type: string - sort order: + - Map-reduce partition columns: - expr: _col0 - type: string - tag: 1 - value expressions: - expr: _col0 - type: string - expr: _col1 - type: string - Reduce Operator Tree: - Join Operator - condition map: - Left Outer Join0 to 1 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col2, _col3 - Select Operator - expressions: - expr: UDFToInteger(_col0) - type: int - expr: _col1 - type: string - expr: UDFToInteger(_col2) - type: int - expr: _col3 - type: string - outputColumnNames: _col0, _col1, _col2, _col3 - File Output Operator - compressed: false - GlobalTableId: 1 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.dest1 - PREHOOK: query: FROM ( FROM ( Index: ql/src/test/results/clientpositive/auto_join10.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join10.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join10.q.out (working copy) @@ -18,20 +18,13 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_ALLCOLREF (TOK_TABNAME src)))))) x) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_ALLCOLREF (TOK_TABNAME src)))))) Y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL Y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION hash (. (TOK_TABLE_OR_COL Y) key) (. (TOK_TABLE_OR_COL Y) value))))))) STAGE DEPENDENCIES: - Stage-6 is a root stage , consists of Stage-7, Stage-8, Stage-1 - Stage-7 has a backup stage: Stage-1 - Stage-4 depends on stages: Stage-7 - Stage-2 depends on stages: Stage-1, Stage-4, Stage-5 - Stage-8 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-8 - Stage-1 + Stage-5 is a root stage + Stage-4 depends on stages: Stage-5 + Stage-2 depends on stages: Stage-4 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-6 - Conditional Operator - - Stage: Stage-7 + Stage: Stage-5 Map Reduce Local Work Alias -> Map Local Tables: y:src @@ -132,151 +125,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-8 - Map Reduce Local Work - Alias -> Map Local Tables: - x:src - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - x:src - TableScan - alias: src - Select Operator - expressions: - expr: key - type: string - outputColumnNames: _col0 - HashTable Sink Operator - condition expressions: - 0 - 1 {_col0} {_col1} - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 1 - - Stage: Stage-5 - Map Reduce - Alias -> Map Operator Tree: - y:src - TableScan - alias: src - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 - 1 {_col0} {_col1} - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - outputColumnNames: _col2, _col3 - Position of Big Table: 1 - Select Operator - expressions: - expr: _col2 - type: string - expr: _col3 - type: string - outputColumnNames: _col2, _col3 - Group By Operator - aggregations: - expr: sum(hash(_col2,_col3)) - bucketGroup: false - mode: hash - 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 - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - x:src - TableScan - alias: src - 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 - y:src - TableScan - alias: src - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Reduce Output Operator - key expressions: - expr: _col0 - type: string - sort order: + - Map-reduce partition columns: - expr: _col0 - type: string - tag: 1 - value expressions: - expr: _col0 - type: string - expr: _col1 - type: string - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 - 1 {VALUE._col0} {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col2, _col3 - Select Operator - expressions: - expr: _col2 - type: string - expr: _col3 - type: string - outputColumnNames: _col2, _col3 - Group By Operator - aggregations: - expr: sum(hash(_col2,_col3)) - bucketGroup: false - mode: hash - 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-0 Fetch Operator limit: -1 Index: ql/src/test/results/clientpositive/auto_join8.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join8.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join8.q.out (working copy) @@ -37,18 +37,13 @@ (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src) src1)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src1) key) c1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src1) value) c2)) (TOK_WHERE (and (> (. (TOK_TABLE_OR_COL src1) key) 10) (< (. (TOK_TABLE_OR_COL src1) key) 20))))) a) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src) src2)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src2) key) c3) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src2) value) c4)) (TOK_WHERE (and (> (. (TOK_TABLE_OR_COL src2) key) 15) (< (. (TOK_TABLE_OR_COL src2) key) 25))))) b) (= (. (TOK_TABLE_OR_COL a) c1) (. (TOK_TABLE_OR_COL b) c3)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) c1) c1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) c2) c2) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) c3) c3) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) c4) c4)))) c)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL c) c1)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL c) c2)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL c) c3)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL c) c4))) (TOK_WHERE (AND (TOK_FUNCTION TOK_ISNULL (. (TOK_TABLE_OR_COL c) c3)) (TOK_FUNCTION TOK_ISNOTNULL (. (TOK_TABLE_OR_COL c) c1)))))) STAGE DEPENDENCIES: - Stage-5 is a root stage , consists of Stage-6, Stage-1 - Stage-6 has a backup stage: Stage-1 - Stage-4 depends on stages: Stage-6 - Stage-0 depends on stages: Stage-1, Stage-4 + Stage-5 is a root stage + Stage-4 depends on stages: Stage-5 + Stage-0 depends on stages: Stage-4 Stage-2 depends on stages: Stage-0 - Stage-1 STAGE PLANS: Stage: Stage-5 - Conditional Operator - - Stage: Stage-6 Map Reduce Local Work Alias -> Map Local Tables: c:b:src2 @@ -147,99 +142,7 @@ Stage: Stage-2 Stats-Aggr Operator - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - c:a:src1 - TableScan - alias: src1 - Filter Operator - predicate: - expr: (((key > 10.0) and (key < 20.0)) and key is not null) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - 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 - expr: _col1 - type: string - c:b:src2 - TableScan - alias: src2 - Filter Operator - predicate: - expr: (((key > 15.0) and (key < 25.0)) and key is not null) - type: boolean - Select Operator - expressions: - expr: key - type: string - expr: value - type: string - outputColumnNames: _col0, _col1 - Reduce Output Operator - key expressions: - expr: _col0 - type: string - sort order: + - Map-reduce partition columns: - expr: _col0 - type: string - tag: 1 - value expressions: - expr: _col0 - type: string - expr: _col1 - type: string - Reduce Operator Tree: - Join Operator - condition map: - Left Outer Join0 to 1 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col2, _col3 - Filter Operator - predicate: - expr: _col2 is null - type: boolean - Select Operator - expressions: - expr: UDFToInteger(_col0) - type: int - expr: _col1 - type: string - expr: UDFToInteger(_col2) - type: int - expr: _col3 - type: string - outputColumnNames: _col0, _col1, _col2, _col3 - File Output Operator - compressed: false - GlobalTableId: 1 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.dest1 - PREHOOK: query: FROM ( FROM ( Index: ql/src/test/results/clientpositive/auto_join3.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join3.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join3.q.out (working copy) @@ -15,34 +15,25 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key))) (TOK_TABREF (TOK_TABNAME src) src3) (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src3) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src1) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-8 is a root stage , consists of Stage-9, Stage-10, Stage-11, Stage-1 - Stage-9 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-9 - Stage-0 depends on stages: Stage-1, Stage-5, Stage-6, Stage-7 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-0 depends on stages: Stage-5 Stage-2 depends on stages: Stage-0 - Stage-10 has a backup stage: Stage-1 - Stage-6 depends on stages: Stage-10 - Stage-11 has a backup stage: Stage-1 - Stage-7 depends on stages: Stage-11 - Stage-1 STAGE PLANS: - Stage: Stage-8 - Conditional Operator - - Stage: Stage-9 + Stage: Stage-6 Map Reduce Local Work Alias -> Map Local Tables: - src2 + src1 Fetch Operator limit: -1 src3 Fetch Operator limit: -1 Alias -> Map Local Operator Tree: - src2 + src1 TableScan - alias: src2 + alias: src1 HashTable Sink Operator condition expressions: 0 {key} @@ -53,7 +44,7 @@ 0 [Column[key]] 1 [Column[key]] 2 [Column[key]] - Position of Big Table: 0 + Position of Big Table: 1 src3 TableScan alias: src3 @@ -67,14 +58,14 @@ 0 [Column[key]] 1 [Column[key]] 2 [Column[key]] - Position of Big Table: 0 + Position of Big Table: 1 Stage: Stage-5 Map Reduce Alias -> Map Operator Tree: - src1 + src2 TableScan - alias: src1 + alias: src2 Map Join Operator condition map: Inner Join 0 to 1 @@ -89,7 +80,7 @@ 1 [Column[key]] 2 [Column[key]] outputColumnNames: _col0, _col9 - Position of Big Table: 0 + Position of Big Table: 1 Select Operator expressions: expr: UDFToInteger(_col0) @@ -121,235 +112,7 @@ Stage: Stage-2 Stats-Aggr Operator - Stage: Stage-10 - Map Reduce Local Work - Alias -> Map Local Tables: - src1 - Fetch Operator - limit: -1 - src3 - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src1 - TableScan - alias: src1 - HashTable Sink Operator - condition expressions: - 0 {key} - 1 - 2 {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 1 - src3 - TableScan - alias: src3 - HashTable Sink Operator - condition expressions: - 0 {key} - 1 - 2 {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 1 - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - src2 - TableScan - alias: src2 - Map Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {key} - 1 - 2 {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - outputColumnNames: _col0, _col9 - Position of Big Table: 1 - Select Operator - expressions: - expr: UDFToInteger(_col0) - type: int - expr: _col9 - type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 1 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.dest1 - Local Work: - Map Reduce Local Work - - Stage: Stage-11 - Map Reduce Local Work - Alias -> Map Local Tables: - src1 - Fetch Operator - limit: -1 - src2 - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src1 - TableScan - alias: src1 - HashTable Sink Operator - condition expressions: - 0 {key} - 1 - 2 {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 2 - src2 - TableScan - alias: src2 - HashTable Sink Operator - condition expressions: - 0 {key} - 1 - 2 {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - Position of Big Table: 2 - - Stage: Stage-7 - Map Reduce - Alias -> Map Operator Tree: - src3 - TableScan - alias: src3 - Map Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {key} - 1 - 2 {value} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - 2 [Column[key]] - outputColumnNames: _col0, _col9 - Position of Big Table: 2 - Select Operator - expressions: - expr: UDFToInteger(_col0) - type: int - expr: _col9 - type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 1 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.dest1 - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - 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 - src2 - TableScan - alias: src2 - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 1 - src3 - TableScan - alias: src3 - Reduce Output Operator - key expressions: - expr: key - type: string - sort order: + - Map-reduce partition columns: - expr: key - type: string - tag: 2 - value expressions: - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {VALUE._col0} - 1 - 2 {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col0, _col9 - Select Operator - expressions: - expr: UDFToInteger(_col0) - type: int - expr: _col9 - type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 1 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.dest1 - - PREHOOK: query: FROM src src1 JOIN src src2 ON (src1.key = src2.key) JOIN src src3 ON (src1.key = src3.key) INSERT OVERWRITE TABLE dest1 SELECT src1.key, src3.value PREHOOK: type: QUERY Index: ql/src/test/results/clientpositive/auto_sortmerge_join_10.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_sortmerge_join_10.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_sortmerge_join_10.q.out (working copy) @@ -68,20 +68,13 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_UNION (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME tbl1) a)) (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 a) value) value)) (TOK_WHERE (< (TOK_TABLE_OR_COL key) 6)))) (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME tbl1) a)) (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 a) value) value)) (TOK_WHERE (< (TOK_TABLE_OR_COL key) 6))))) usubq1)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)))) subq1) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME tbl2) a)) (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 a) value) value)) (TOK_WHERE (< (TOK_TABLE_OR_COL key) 6)))) 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_FUNCTIONSTAR count))))) STAGE DEPENDENCIES: - Stage-7 is a root stage , consists of Stage-8, Stage-9, Stage-1 - Stage-8 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-8 - Stage-2 depends on stages: Stage-1, Stage-5, Stage-6 - Stage-9 has a backup stage: Stage-1 - Stage-6 depends on stages: Stage-9 - Stage-1 + Stage-6 is a root stage + Stage-5 depends on stages: Stage-6 + Stage-2 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-7 - Conditional Operator - - Stage: Stage-8 + Stage: Stage-6 Map Reduce Local Work Alias -> Map Local Tables: subq2:a @@ -233,221 +226,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-9 - Map Reduce Local Work - Alias -> Map Local Tables: - subq1-subquery1:usubq1-subquery1:a - Fetch Operator - limit: -1 - subq1-subquery2:usubq1-subquery2:a - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - subq1-subquery1:usubq1-subquery1:a - TableScan - alias: a - Filter Operator - predicate: - expr: (key < 6) - type: boolean - Select Operator - expressions: - expr: key - type: int - expr: value - type: string - outputColumnNames: _col0, _col1 - Union - Select Operator - expressions: - expr: _col0 - type: int - outputColumnNames: _col0 - HashTable Sink Operator - condition expressions: - 0 - 1 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 1 - subq1-subquery2:usubq1-subquery2:a - TableScan - alias: a - Filter Operator - predicate: - expr: (key < 6) - type: boolean - Select Operator - expressions: - expr: key - type: int - expr: value - type: string - outputColumnNames: _col0, _col1 - Union - Select Operator - expressions: - expr: _col0 - type: int - outputColumnNames: _col0 - HashTable Sink Operator - condition expressions: - 0 - 1 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 1 - - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - subq2:a - TableScan - alias: a - Filter Operator - predicate: - expr: (key < 6) - type: boolean - Select Operator - expressions: - expr: key - type: int - outputColumnNames: _col0 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 - 1 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 1 - Select Operator - Group By Operator - aggregations: - expr: count() - bucketGroup: false - mode: hash - 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 - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - subq1-subquery1:usubq1-subquery1:a - TableScan - alias: a - Filter Operator - predicate: - expr: (key < 6) - type: boolean - Select Operator - expressions: - expr: key - type: int - expr: value - type: string - outputColumnNames: _col0, _col1 - Union - Select Operator - expressions: - expr: _col0 - type: int - outputColumnNames: _col0 - Reduce Output Operator - key expressions: - expr: _col0 - type: int - sort order: + - Map-reduce partition columns: - expr: _col0 - type: int - tag: 0 - subq1-subquery2:usubq1-subquery2:a - TableScan - alias: a - Filter Operator - predicate: - expr: (key < 6) - type: boolean - Select Operator - expressions: - expr: key - type: int - expr: value - type: string - outputColumnNames: _col0, _col1 - Union - Select Operator - expressions: - expr: _col0 - type: int - outputColumnNames: _col0 - Reduce Output Operator - key expressions: - expr: _col0 - type: int - sort order: + - Map-reduce partition columns: - expr: _col0 - type: int - tag: 0 - subq2:a - TableScan - alias: a - Filter Operator - predicate: - expr: (key < 6) - type: boolean - Select Operator - expressions: - expr: key - type: int - outputColumnNames: _col0 - Reduce Output Operator - key expressions: - expr: _col0 - type: int - sort order: + - Map-reduce partition columns: - expr: _col0 - type: int - tag: 1 - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 - 1 - handleSkewJoin: false - Select Operator - Group By Operator - aggregations: - expr: count() - bucketGroup: false - mode: hash - 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-0 Fetch Operator limit: -1 @@ -511,13 +289,9 @@ STAGE DEPENDENCIES: Stage-1 is a root stage - Stage-7 depends on stages: Stage-1 , consists of Stage-8, Stage-9, Stage-2 - Stage-8 has a backup stage: Stage-2 - Stage-5 depends on stages: Stage-8 - Stage-3 depends on stages: Stage-2, Stage-5, Stage-6 - Stage-9 has a backup stage: Stage-2 - Stage-6 depends on stages: Stage-9 - Stage-2 + Stage-6 depends on stages: Stage-1 + Stage-5 depends on stages: Stage-6 + Stage-3 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: @@ -579,10 +353,7 @@ input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - Stage: Stage-7 - Conditional Operator - - Stage: Stage-8 + Stage: Stage-6 Map Reduce Local Work Alias -> Map Local Tables: subq2:a @@ -671,122 +442,6 @@ input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - Stage: Stage-9 - Map Reduce Local Work - Alias -> Map Local Tables: - $INTNAME - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - $INTNAME - HashTable Sink Operator - condition expressions: - 0 - 1 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 1 - - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - subq2:a - TableScan - alias: a - Filter Operator - predicate: - expr: (key < 6) - type: boolean - Select Operator - expressions: - expr: key - type: int - outputColumnNames: _col0 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 - 1 - handleSkewJoin: false - keys: - 0 [Column[_col0]] - 1 [Column[_col0]] - Position of Big Table: 1 - Select Operator - Group By Operator - aggregations: - expr: count() - bucketGroup: false - mode: hash - 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 - Local Work: - Map Reduce Local Work - - Stage: Stage-2 - Map Reduce - Alias -> Map Operator Tree: - $INTNAME - Reduce Output Operator - key expressions: - expr: _col0 - type: int - sort order: + - Map-reduce partition columns: - expr: _col0 - type: int - tag: 0 - subq2:a - TableScan - alias: a - Filter Operator - predicate: - expr: (key < 6) - type: boolean - Select Operator - expressions: - expr: key - type: int - outputColumnNames: _col0 - Reduce Output Operator - key expressions: - expr: _col0 - type: int - sort order: + - Map-reduce partition columns: - expr: _col0 - type: int - tag: 1 - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 - 1 - handleSkewJoin: false - Select Operator - Group By Operator - aggregations: - expr: count() - bucketGroup: false - mode: hash - 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-0 Fetch Operator limit: -1 Index: ql/src/test/results/clientpositive/join_reorder4.q.out =================================================================== --- ql/src/test/results/clientpositive/join_reorder4.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/join_reorder4.q.out (working copy) @@ -39,108 +39,15 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME T1) a) (TOK_TABREF (TOK_TABNAME T2) b) (= (. (TOK_TABLE_OR_COL a) key1) (. (TOK_TABLE_OR_COL b) key2))) (TOK_TABREF (TOK_TABNAME T3) c) (= (. (TOK_TABLE_OR_COL a) key1) (. (TOK_TABLE_OR_COL c) key3)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_HINTLIST (TOK_HINT TOK_STREAMTABLE (TOK_HINTARGLIST a))) (TOK_SELEXPR (TOK_ALLCOLREF (TOK_TABNAME a))) (TOK_SELEXPR (TOK_ALLCOLREF (TOK_TABNAME b))) (TOK_SELEXPR (TOK_ALLCOLREF (TOK_TABNAME c)))))) STAGE DEPENDENCIES: - Stage-7 is a root stage , consists of Stage-8, Stage-9, Stage-10, Stage-1 - Stage-8 has a backup stage: Stage-1 - Stage-4 depends on stages: Stage-8 - Stage-9 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-9 - Stage-10 has a backup stage: Stage-1 - Stage-6 depends on stages: Stage-10 - Stage-1 + Stage-5 is a root stage + Stage-4 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-7 - Conditional Operator - - Stage: Stage-8 + Stage: Stage-5 Map Reduce Local Work Alias -> Map Local Tables: - b - Fetch Operator - limit: -1 - c - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - b - TableScan - alias: b - HashTable Sink Operator - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - Position of Big Table: 0 - c - TableScan - alias: c - HashTable Sink Operator - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - Position of Big Table: 0 - - Stage: Stage-4 - Map Reduce - Alias -> Map Operator Tree: a - TableScan - alias: a - Map Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 0 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - 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-9 - Map Reduce Local Work - Alias -> Map Local Tables: - a Fetch Operator limit: -1 c @@ -176,7 +83,7 @@ 2 [Column[key3]] Position of Big Table: 1 - Stage: Stage-5 + Stage: Stage-4 Map Reduce Alias -> Map Operator Tree: b @@ -221,177 +128,6 @@ Local Work: Map Reduce Local Work - Stage: Stage-10 - Map Reduce Local Work - Alias -> Map Local Tables: - a - Fetch Operator - limit: -1 - b - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - a - TableScan - alias: a - HashTable Sink Operator - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - Position of Big Table: 2 - b - TableScan - alias: b - HashTable Sink Operator - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - Position of Big Table: 2 - - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - c - TableScan - alias: c - Map Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 2 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - 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-1 - Map Reduce - Alias -> Map Operator Tree: - a - TableScan - alias: a - Reduce Output Operator - key expressions: - expr: key1 - type: string - sort order: + - Map-reduce partition columns: - expr: key1 - type: string - tag: 2 - value expressions: - expr: key1 - type: string - expr: val1 - type: string - b - TableScan - alias: b - Reduce Output Operator - key expressions: - expr: key2 - type: string - sort order: + - Map-reduce partition columns: - expr: key2 - type: string - tag: 1 - value expressions: - expr: key2 - type: string - expr: val2 - type: string - c - TableScan - alias: c - Reduce Output Operator - key expressions: - expr: key3 - type: string - sort order: + - Map-reduce partition columns: - expr: key3 - type: string - tag: 0 - value expressions: - expr: key3 - type: string - expr: val3 - type: string - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - 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 - Stage: Stage-0 Fetch Operator limit: -1 @@ -418,108 +154,15 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME T1) a) (TOK_TABREF (TOK_TABNAME T2) b) (= (. (TOK_TABLE_OR_COL a) key1) (. (TOK_TABLE_OR_COL b) key2))) (TOK_TABREF (TOK_TABNAME T3) c) (= (. (TOK_TABLE_OR_COL a) key1) (. (TOK_TABLE_OR_COL c) key3)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_HINTLIST (TOK_HINT TOK_STREAMTABLE (TOK_HINTARGLIST b))) (TOK_SELEXPR (TOK_ALLCOLREF (TOK_TABNAME a))) (TOK_SELEXPR (TOK_ALLCOLREF (TOK_TABNAME b))) (TOK_SELEXPR (TOK_ALLCOLREF (TOK_TABNAME c)))))) STAGE DEPENDENCIES: - Stage-7 is a root stage , consists of Stage-8, Stage-9, Stage-10, Stage-1 - Stage-8 has a backup stage: Stage-1 - Stage-4 depends on stages: Stage-8 - Stage-9 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-9 - Stage-10 has a backup stage: Stage-1 - Stage-6 depends on stages: Stage-10 - Stage-1 + Stage-5 is a root stage + Stage-4 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-7 - Conditional Operator - - Stage: Stage-8 + Stage: Stage-5 Map Reduce Local Work Alias -> Map Local Tables: - b - Fetch Operator - limit: -1 - c - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - b - TableScan - alias: b - HashTable Sink Operator - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - Position of Big Table: 0 - c - TableScan - alias: c - HashTable Sink Operator - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - Position of Big Table: 0 - - Stage: Stage-4 - Map Reduce - Alias -> Map Operator Tree: a - TableScan - alias: a - Map Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 0 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - 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-9 - Map Reduce Local Work - Alias -> Map Local Tables: - a Fetch Operator limit: -1 c @@ -555,7 +198,7 @@ 2 [Column[key3]] Position of Big Table: 1 - Stage: Stage-5 + Stage: Stage-4 Map Reduce Alias -> Map Operator Tree: b @@ -600,177 +243,6 @@ Local Work: Map Reduce Local Work - Stage: Stage-10 - Map Reduce Local Work - Alias -> Map Local Tables: - a - Fetch Operator - limit: -1 - b - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - a - TableScan - alias: a - HashTable Sink Operator - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - Position of Big Table: 2 - b - TableScan - alias: b - HashTable Sink Operator - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - Position of Big Table: 2 - - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - c - TableScan - alias: c - Map Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 2 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - 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-1 - Map Reduce - Alias -> Map Operator Tree: - a - TableScan - alias: a - Reduce Output Operator - key expressions: - expr: key1 - type: string - sort order: + - Map-reduce partition columns: - expr: key1 - type: string - tag: 0 - value expressions: - expr: key1 - type: string - expr: val1 - type: string - b - TableScan - alias: b - Reduce Output Operator - key expressions: - expr: key2 - type: string - sort order: + - Map-reduce partition columns: - expr: key2 - type: string - tag: 2 - value expressions: - expr: key2 - type: string - expr: val2 - type: string - c - TableScan - alias: c - Reduce Output Operator - key expressions: - expr: key3 - type: string - sort order: + - Map-reduce partition columns: - expr: key3 - type: string - tag: 1 - value expressions: - expr: key3 - type: string - expr: val3 - type: string - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - 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 - Stage: Stage-0 Fetch Operator limit: -1 @@ -797,108 +269,15 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME T1) a) (TOK_TABREF (TOK_TABNAME T2) b) (= (. (TOK_TABLE_OR_COL a) key1) (. (TOK_TABLE_OR_COL b) key2))) (TOK_TABREF (TOK_TABNAME T3) c) (= (. (TOK_TABLE_OR_COL a) key1) (. (TOK_TABLE_OR_COL c) key3)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_HINTLIST (TOK_HINT TOK_STREAMTABLE (TOK_HINTARGLIST c))) (TOK_SELEXPR (TOK_ALLCOLREF (TOK_TABNAME a))) (TOK_SELEXPR (TOK_ALLCOLREF (TOK_TABNAME b))) (TOK_SELEXPR (TOK_ALLCOLREF (TOK_TABNAME c)))))) STAGE DEPENDENCIES: - Stage-7 is a root stage , consists of Stage-8, Stage-9, Stage-10, Stage-1 - Stage-8 has a backup stage: Stage-1 - Stage-4 depends on stages: Stage-8 - Stage-9 has a backup stage: Stage-1 - Stage-5 depends on stages: Stage-9 - Stage-10 has a backup stage: Stage-1 - Stage-6 depends on stages: Stage-10 - Stage-1 + Stage-5 is a root stage + Stage-4 depends on stages: Stage-5 Stage-0 is a root stage STAGE PLANS: - Stage: Stage-7 - Conditional Operator - - Stage: Stage-8 + Stage: Stage-5 Map Reduce Local Work Alias -> Map Local Tables: - b - Fetch Operator - limit: -1 - c - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - b - TableScan - alias: b - HashTable Sink Operator - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - Position of Big Table: 0 - c - TableScan - alias: c - HashTable Sink Operator - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - Position of Big Table: 0 - - Stage: Stage-4 - Map Reduce - Alias -> Map Operator Tree: a - TableScan - alias: a - Map Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 0 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - 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-9 - Map Reduce Local Work - Alias -> Map Local Tables: - a Fetch Operator limit: -1 c @@ -934,7 +313,7 @@ 2 [Column[key3]] Position of Big Table: 1 - Stage: Stage-5 + Stage: Stage-4 Map Reduce Alias -> Map Operator Tree: b @@ -979,177 +358,6 @@ Local Work: Map Reduce Local Work - Stage: Stage-10 - Map Reduce Local Work - Alias -> Map Local Tables: - a - Fetch Operator - limit: -1 - b - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - a - TableScan - alias: a - HashTable Sink Operator - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - Position of Big Table: 2 - b - TableScan - alias: b - HashTable Sink Operator - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - Position of Big Table: 2 - - Stage: Stage-6 - Map Reduce - Alias -> Map Operator Tree: - c - TableScan - alias: c - Map Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {key1} {val1} - 1 {key2} {val2} - 2 {key3} {val3} - handleSkewJoin: false - keys: - 0 [Column[key1]] - 1 [Column[key2]] - 2 [Column[key3]] - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Position of Big Table: 2 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - 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-1 - Map Reduce - Alias -> Map Operator Tree: - a - TableScan - alias: a - Reduce Output Operator - key expressions: - expr: key1 - type: string - sort order: + - Map-reduce partition columns: - expr: key1 - type: string - tag: 0 - value expressions: - expr: key1 - type: string - expr: val1 - type: string - b - TableScan - alias: b - Reduce Output Operator - key expressions: - expr: key2 - type: string - sort order: + - Map-reduce partition columns: - expr: key2 - type: string - tag: 1 - value expressions: - expr: key2 - type: string - expr: val2 - type: string - c - TableScan - alias: c - Reduce Output Operator - key expressions: - expr: key3 - type: string - sort order: + - Map-reduce partition columns: - expr: key3 - type: string - tag: 2 - value expressions: - expr: key3 - type: string - expr: val3 - type: string - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - Inner Join 0 to 2 - condition expressions: - 0 {VALUE._col0} {VALUE._col1} - 1 {VALUE._col0} {VALUE._col1} - 2 {VALUE._col0} {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9 - Select Operator - expressions: - expr: _col0 - type: string - expr: _col1 - type: string - expr: _col4 - type: string - expr: _col5 - type: string - expr: _col8 - type: string - expr: _col9 - 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 - Stage: Stage-0 Fetch Operator limit: -1 Index: ql/src/test/results/clientpositive/auto_join2.q.out =================================================================== --- ql/src/test/results/clientpositive/auto_join2.q.out (revision 1457610) +++ ql/src/test/results/clientpositive/auto_join2.q.out (working copy) @@ -15,54 +15,26 @@ (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME src) src1) (TOK_TABREF (TOK_TABNAME src) src2) (= (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key))) (TOK_TABREF (TOK_TABNAME src) src3) (= (+ (. (TOK_TABLE_OR_COL src1) key) (. (TOK_TABLE_OR_COL src2) key)) (. (TOK_TABLE_OR_COL src3) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_j2))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src1) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src3) value))))) STAGE DEPENDENCIES: - Stage-11 is a root stage , consists of Stage-14, Stage-15, Stage-1 - Stage-14 has a backup stage: Stage-1 - Stage-9 depends on stages: Stage-14 - Stage-8 depends on stages: Stage-1, Stage-9, Stage-10 , consists of Stage-12, Stage-13, Stage-2 - Stage-12 has a backup stage: Stage-2 - Stage-6 depends on stages: Stage-12 - Stage-0 depends on stages: Stage-2, Stage-6, Stage-7 + Stage-8 is a root stage + Stage-7 depends on stages: Stage-8 + Stage-0 depends on stages: Stage-7 Stage-3 depends on stages: Stage-0 - Stage-13 has a backup stage: Stage-2 - Stage-7 depends on stages: Stage-13 - Stage-2 - Stage-15 has a backup stage: Stage-1 - Stage-10 depends on stages: Stage-15 - Stage-1 STAGE PLANS: - Stage: Stage-11 - Conditional Operator - - Stage: Stage-14 + Stage: Stage-8 Map Reduce Local Work Alias -> Map Local Tables: - src2 + src1 Fetch Operator limit: -1 + src3 + Fetch Operator + limit: -1 Alias -> Map Local Operator Tree: - src2 - TableScan - alias: src2 - HashTable Sink Operator - condition expressions: - 0 {key} - 1 {key} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - Position of Big Table: 0 - - Stage: Stage-9 - Map Reduce - Alias -> Map Operator Tree: src1 TableScan alias: src1 - Map Join Operator - condition map: - Inner Join 0 to 1 + HashTable Sink Operator condition expressions: 0 {key} 1 {key} @@ -70,28 +42,8 @@ keys: 0 [Column[key]] 1 [Column[key]] - outputColumnNames: _col0, _col4 - Position of Big Table: 0 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - Local Work: - Map Reduce Local Work - - Stage: Stage-8 - Conditional Operator - - Stage: Stage-12 - Map Reduce Local Work - Alias -> Map Local Tables: + Position of Big Table: 1 src3 - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src3 TableScan alias: src3 HashTable Sink Operator @@ -104,37 +56,51 @@ 1 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[key]()] Position of Big Table: 0 - Stage: Stage-6 + Stage: Stage-7 Map Reduce Alias -> Map Operator Tree: - $INTNAME + src2 + TableScan + alias: src2 Map Join Operator condition map: Inner Join 0 to 1 condition expressions: - 0 {_col0} - 1 {value} + 0 {key} + 1 {key} handleSkewJoin: false keys: - 0 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[_col0], Column[_col4]()] - 1 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[key]()] - outputColumnNames: _col4, _col9 - Position of Big Table: 0 - Select Operator - expressions: - expr: UDFToInteger(_col4) - type: int - expr: _col9 - type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 1 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.dest_j2 + 0 [Column[key]] + 1 [Column[key]] + outputColumnNames: _col0, _col4 + Position of Big Table: 1 + Map Join Operator + condition map: + Inner Join 0 to 1 + condition expressions: + 0 {_col0} + 1 {value} + handleSkewJoin: false + keys: + 0 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[_col0], Column[_col4]()] + 1 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[key]()] + outputColumnNames: _col4, _col9 + Position of Big Table: 0 + Select Operator + expressions: + expr: UDFToInteger(_col4) + type: int + expr: _col9 + type: string + outputColumnNames: _col0, _col1 + File Output Operator + compressed: false + GlobalTableId: 1 + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + name: default.dest_j2 Local Work: Map Reduce Local Work @@ -151,213 +117,7 @@ Stage: Stage-3 Stats-Aggr Operator - Stage: Stage-13 - Map Reduce Local Work - Alias -> Map Local Tables: - $INTNAME - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - $INTNAME - HashTable Sink Operator - condition expressions: - 0 {_col0} - 1 {value} - handleSkewJoin: false - keys: - 0 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[_col0], Column[_col4]()] - 1 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[key]()] - Position of Big Table: 1 - Stage: Stage-7 - Map Reduce - Alias -> Map Operator Tree: - src3 - TableScan - alias: src3 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {_col0} - 1 {value} - handleSkewJoin: false - keys: - 0 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[_col0], Column[_col4]()] - 1 [class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[key]()] - outputColumnNames: _col4, _col9 - Position of Big Table: 1 - Select Operator - expressions: - expr: UDFToInteger(_col4) - type: int - expr: _col9 - type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 1 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.dest_j2 - Local Work: - Map Reduce Local Work - - Stage: Stage-2 - Map Reduce - Alias -> Map Operator Tree: - $INTNAME - Reduce Output Operator - key expressions: - expr: (_col0 + _col4) - type: double - sort order: + - Map-reduce partition columns: - expr: (_col0 + _col4) - type: double - tag: 0 - value expressions: - expr: _col0 - type: string - src3 - TableScan - alias: src3 - Reduce Output Operator - key expressions: - expr: UDFToDouble(key) - type: double - sort order: + - Map-reduce partition columns: - expr: UDFToDouble(key) - type: double - tag: 1 - value expressions: - expr: value - type: string - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {VALUE._col4} - 1 {VALUE._col1} - handleSkewJoin: false - outputColumnNames: _col4, _col9 - Select Operator - expressions: - expr: UDFToInteger(_col4) - type: int - expr: _col9 - type: string - outputColumnNames: _col0, _col1 - File Output Operator - compressed: false - GlobalTableId: 1 - table: - input format: org.apache.hadoop.mapred.TextInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat - serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe - name: default.dest_j2 - - Stage: Stage-15 - Map Reduce Local Work - Alias -> Map Local Tables: - src1 - Fetch Operator - limit: -1 - Alias -> Map Local Operator Tree: - src1 - TableScan - alias: src1 - HashTable Sink Operator - condition expressions: - 0 {key} - 1 {key} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - Position of Big Table: 1 - - Stage: Stage-10 - Map Reduce - Alias -> Map Operator Tree: - src2 - TableScan - alias: src2 - Map Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {key} - 1 {key} - handleSkewJoin: false - keys: - 0 [Column[key]] - 1 [Column[key]] - outputColumnNames: _col0, _col4 - Position of Big Table: 1 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - Local Work: - Map Reduce Local Work - - Stage: Stage-1 - Map Reduce - Alias -> Map Operator Tree: - src1 - TableScan - alias: src1 - 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 - src2 - TableScan - alias: src2 - 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 - Reduce Operator Tree: - Join Operator - condition map: - Inner Join 0 to 1 - condition expressions: - 0 {VALUE._col0} - 1 {VALUE._col0} - handleSkewJoin: false - outputColumnNames: _col0, _col4 - File Output Operator - compressed: false - GlobalTableId: 0 - table: - input format: org.apache.hadoop.mapred.SequenceFileInputFormat - output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat - - PREHOOK: query: FROM src src1 JOIN src src2 ON (src1.key = src2.key) JOIN src src3 ON (src1.key + src2.key = src3.key) INSERT OVERWRITE TABLE dest_j2 SELECT src1.key, src3.value PREHOOK: type: QUERY Index: ql/src/test/queries/clientpositive/join41.q =================================================================== --- ql/src/test/queries/clientpositive/join41.q (revision 0) +++ ql/src/test/queries/clientpositive/join41.q (working copy) @@ -0,0 +1,16 @@ +create table s1 as select * from src where key = 0; + +set hive.auto.convert.join.noconditionaltask=false; +EXPLAIN +SELECT * FROM s1 src1 LEFT OUTER JOIN s1 src2 ON (src1.key = src2.key AND src2.key > 10); +SELECT * FROM s1 src1 LEFT OUTER JOIN s1 src2 ON (src1.key = src2.key AND src2.key > 10); + +set hive.auto.convert.join.noconditionaltask=true; + +-- Make sure the big table is chosen correctly as part of HIVE-4146 +EXPLAIN +SELECT * FROM s1 src1 LEFT OUTER JOIN s1 src2 ON (src1.key = src2.key AND src2.key > 10); +SELECT * FROM s1 src1 LEFT OUTER JOIN s1 src2 ON (src1.key = src2.key AND src2.key > 10); + + + Index: ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/CommonJoinResolver.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/CommonJoinResolver.java (revision 1457610) +++ ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/CommonJoinResolver.java (working copy) @@ -329,31 +329,35 @@ HiveConf.ConfVars.HIVECONVERTJOINNOCONDITIONALTASKTHRESHOLD); boolean bigTableFound = false; - long largestTableSize = 0; + long largestBigTableCandidateSize = 0; long sumTableSizes = 0; for (String alias : aliasToWork.keySet()) { + int tablePosition = getPosition(currWork, joinOp, alias); + boolean bigTableCandidate = bigTableCandidates.contains(tablePosition); Long size = aliasToSize.get(alias); // The size is not available at compile time if the input is a sub-query. // If the size of atleast n-1 inputs for a n-way join are available at compile time, // and the sum of them is less than the specified threshold, then convert the join // into a map-join without the conditional task. if ((size == null) || (size > mapJoinSize)) { - sumTableSizes += largestTableSize; - if (bigTableFound || (sumTableSizes > mapJoinSize)) { + sumTableSizes += largestBigTableCandidateSize; + if (bigTableFound || (sumTableSizes > mapJoinSize) || !bigTableCandidate) { convertJoinMapJoin = false; break; } bigTableFound = true; - bigTablePosition = getPosition(currWork, joinOp, alias); - largestTableSize = mapJoinSize + 1; + bigTablePosition = tablePosition; + largestBigTableCandidateSize = mapJoinSize + 1; } else { - if (size > largestTableSize) { - sumTableSizes += largestTableSize; - largestTableSize = size; - bigTablePosition = getPosition(currWork, joinOp, alias); - } else { + if (bigTableCandidate && size > largestBigTableCandidateSize) { + bigTablePosition = tablePosition; + sumTableSizes += largestBigTableCandidateSize; + largestBigTableCandidateSize = size; + } + else { sumTableSizes += size; } + if (sumTableSizes > mapJoinSize) { convertJoinMapJoin = false; break;