Saving all output to "!!{outputDirectory}!!/mapjoin_mapjoin.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/mapjoin_mapjoin.q >>> explain select /*+MAPJOIN(src, src1) */ srcpart.key from srcpart join src on (srcpart.value=src.value) join src1 on (srcpart.key=src1.key); 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME srcpart)) (TOK_TABREF (TOK_TABNAME src)) (= (. (TOK_TABLE_OR_COL srcpart) value) (. (TOK_TABLE_OR_COL src) value))) (TOK_TABREF (TOK_TABNAME src1)) (= (. (TOK_TABLE_OR_COL srcpart) key) (. (TOK_TABLE_OR_COL src1) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_HINTLIST (TOK_HINT TOK_MAPJOIN (TOK_HINTARGLIST src src1))) (TOK_SELEXPR (. (TOK_TABLE_OR_COL srcpart) key)))))' '' 'STAGE DEPENDENCIES:' ' Stage-6 is a root stage' ' Stage-1 depends on stages: Stage-6' ' Stage-5 depends on stages: Stage-1' ' Stage-2 depends on stages: Stage-5' ' Stage-0 is a root stage' '' 'STAGE PLANS:' ' Stage: Stage-6' ' Map Reduce Local Work' ' Alias -> Map Local Tables:' ' src ' ' Fetch Operator' ' limit: -1' ' Alias -> Map Local Operator Tree:' ' src ' ' TableScan' ' alias: src' ' HashTable Sink Operator' ' condition expressions:' ' 0 {key}' ' 1 ' ' handleSkewJoin: false' ' keys:' ' 0 [Column[value]]' ' 1 [Column[value]]' ' Position of Big Table: 0' '' ' Stage: Stage-1' ' Map Reduce' ' Alias -> Map Operator Tree:' ' srcpart ' ' TableScan' ' alias: srcpart' ' Map Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {key}' ' 1 ' ' handleSkewJoin: false' ' keys:' ' 0 [Column[value]]' ' 1 [Column[value]]' ' outputColumnNames: _col0' ' 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-5' ' 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 {_col0}' ' 1 ' ' handleSkewJoin: false' ' keys:' ' 0 [Column[_col0]]' ' 1 [Column[key]]' ' Position of Big Table: 0' '' ' Stage: Stage-2' ' Map Reduce' ' Alias -> Map Operator Tree:' ' file:!!{hive.exec.scratchdir}!! ' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' outputColumnNames: _col0' ' Map Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {_col0}' ' 1 ' ' handleSkewJoin: false' ' keys:' ' 0 [Column[_col0]]' ' 1 [Column[key]]' ' outputColumnNames: _col0' ' Position of Big Table: 0' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' outputColumnNames: _col0' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' outputColumnNames: _col0' ' File Output Operator' ' compressed: false' ' GlobalTableId: 0' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' Local Work:' ' Map Reduce Local Work' '' ' Stage: Stage-0' ' Fetch Operator' ' limit: -1' '' '' 123 rows selected >>> >>> explain select /*+MAPJOIN(src, src1) */ count(*) from srcpart join src on (srcpart.value=src.value) join src1 on (srcpart.key=src1.key) group by ds; 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME srcpart)) (TOK_TABREF (TOK_TABNAME src)) (= (. (TOK_TABLE_OR_COL srcpart) value) (. (TOK_TABLE_OR_COL src) value))) (TOK_TABREF (TOK_TABNAME src1)) (= (. (TOK_TABLE_OR_COL srcpart) key) (. (TOK_TABLE_OR_COL src1) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_HINTLIST (TOK_HINT TOK_MAPJOIN (TOK_HINTARGLIST src src1))) (TOK_SELEXPR (TOK_FUNCTIONSTAR count))) (TOK_GROUPBY (TOK_TABLE_OR_COL ds))))' '' 'STAGE DEPENDENCIES:' ' Stage-7 is a root stage' ' Stage-1 depends on stages: Stage-7' ' Stage-6 depends on stages: Stage-1' ' Stage-2 depends on stages: Stage-6' ' Stage-3 depends on stages: Stage-2' ' Stage-0 is a root stage' '' 'STAGE PLANS:' ' Stage: Stage-7' ' Map Reduce Local Work' ' Alias -> Map Local Tables:' ' src ' ' Fetch Operator' ' limit: -1' ' Alias -> Map Local Operator Tree:' ' src ' ' TableScan' ' alias: src' ' HashTable Sink Operator' ' condition expressions:' ' 0 {key} {ds}' ' 1 ' ' handleSkewJoin: false' ' keys:' ' 0 [Column[value]]' ' 1 [Column[value]]' ' Position of Big Table: 0' '' ' Stage: Stage-1' ' Map Reduce' ' Alias -> Map Operator Tree:' ' srcpart ' ' TableScan' ' alias: srcpart' ' Map Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {key} {ds}' ' 1 ' ' handleSkewJoin: false' ' keys:' ' 0 [Column[value]]' ' 1 [Column[value]]' ' outputColumnNames: _col0, _col2' ' 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-6' ' 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 {_col2}' ' 1 ' ' handleSkewJoin: false' ' keys:' ' 0 [Column[_col0]]' ' 1 [Column[key]]' ' Position of Big Table: 0' '' ' Stage: Stage-2' ' Map Reduce' ' Alias -> Map Operator Tree:' ' file:!!{hive.exec.scratchdir}!! ' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' expr: _col2' ' type: string' ' outputColumnNames: _col0, _col2' ' Map Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {_col2}' ' 1 ' ' handleSkewJoin: false' ' keys:' ' 0 [Column[_col0]]' ' 1 [Column[key]]' ' outputColumnNames: _col2' ' 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-3' ' Map Reduce' ' Alias -> Map Operator Tree:' ' file:!!{hive.exec.scratchdir}!! ' ' Select Operator' ' expressions:' ' expr: _col2' ' type: string' ' outputColumnNames: _col2' ' Select Operator' ' expressions:' ' expr: _col2' ' type: string' ' outputColumnNames: _col2' ' Group By Operator' ' aggregations:' ' expr: count()' ' bucketGroup: false' ' keys:' ' expr: _col2' ' type: string' ' mode: hash' ' 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: bigint' ' Reduce Operator Tree:' ' Group By Operator' ' aggregations:' ' expr: count(VALUE._col0)' ' bucketGroup: false' ' keys:' ' expr: KEY._col0' ' type: string' ' mode: mergepartial' ' outputColumnNames: _col0, _col1' ' Select Operator' ' expressions:' ' expr: _col1' ' type: bigint' ' outputColumnNames: _col0' ' 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' '' '' 173 rows selected >>> >>> select /*+MAPJOIN(src, src1) */ count(*) from srcpart join src src on (srcpart.value=src.value) join src src1 on (srcpart.key=src1.key) group by ds; '_c1' '5308' '5308' 2 rows selected >>> !record