Saving all output to "!!{outputDirectory}!!/join_reorder2.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/join_reorder2.q >>> >>> >>> >>> >>> >>> CREATE TABLE T1(key STRING, val STRING) STORED AS TEXTFILE; No rows affected >>> CREATE TABLE T2(key STRING, val STRING) STORED AS TEXTFILE; No rows affected >>> CREATE TABLE T3(key STRING, val STRING) STORED AS TEXTFILE; No rows affected >>> CREATE TABLE T4(key STRING, val STRING) STORED AS TEXTFILE; No rows affected >>> >>> LOAD DATA LOCAL INPATH '../data/files/T1.txt' INTO TABLE T1; No rows affected >>> LOAD DATA LOCAL INPATH '../data/files/T2.txt' INTO TABLE T2; No rows affected >>> LOAD DATA LOCAL INPATH '../data/files/T3.txt' INTO TABLE T3; No rows affected >>> LOAD DATA LOCAL INPATH '../data/files/T1.txt' INTO TABLE T4; No rows affected >>> >>> EXPLAIN SELECT /*+ STREAMTABLE(a) */ * FROM T1 a JOIN T2 b ON a.key = b.key JOIN T3 c ON b.key = c.key JOIN T4 d ON c.key = d.key; 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME T1) a) (TOK_TABREF (TOK_TABNAME T2) b) (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key))) (TOK_TABREF (TOK_TABNAME T3) c) (= (. (TOK_TABLE_OR_COL b) key) (. (TOK_TABLE_OR_COL c) key))) (TOK_TABREF (TOK_TABNAME T4) d) (= (. (TOK_TABLE_OR_COL c) key) (. (TOK_TABLE_OR_COL d) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_HINTLIST (TOK_HINT TOK_STREAMTABLE (TOK_HINTARGLIST a))) (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:' ' a ' ' TableScan' ' alias: a' ' Reduce Output Operator' ' key expressions:' ' expr: key' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: key' ' type: string' ' tag: 3' ' value expressions:' ' expr: key' ' type: string' ' expr: val' ' 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: val' ' type: string' ' c ' ' TableScan' ' alias: c' ' 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: val' ' type: string' ' d ' ' TableScan' ' alias: d' ' Reduce Output Operator' ' key expressions:' ' expr: key' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: key' ' type: string' ' tag: 0' ' value expressions:' ' expr: key' ' type: string' ' expr: val' ' type: string' ' Reduce Operator Tree:' ' Join Operator' ' condition map:' ' Inner Join 0 to 1' ' Inner Join 1 to 2' ' Inner Join 2 to 3' ' condition expressions:' ' 0 {VALUE._col0} {VALUE._col1}' ' 1 {VALUE._col0} {VALUE._col1}' ' 2 {VALUE._col0} {VALUE._col1}' ' 3 {VALUE._col0} {VALUE._col1}' ' handleSkewJoin: false' ' outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9, _col12, _col13' ' 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' ' expr: _col12' ' type: string' ' expr: _col13' ' type: string' ' outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7' ' 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' '' '' 123 rows selected >>> >>> SELECT /*+ STREAMTABLE(a) */ * FROM T1 a JOIN T2 b ON a.key = b.key JOIN T3 c ON b.key = c.key JOIN T4 d ON c.key = d.key; 'key','val','key','val','key','val','key','val' '2','12','2','22','2','12','2','12' 1 row selected >>> >>> >>> EXPLAIN SELECT /*+ STREAMTABLE(a) */ * FROM T1 a JOIN T2 b ON a.key = b.key JOIN T3 c ON a.val = c.val JOIN T4 d ON a.key + 1 = d.key + 1; 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME T1) a) (TOK_TABREF (TOK_TABNAME T2) b) (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key))) (TOK_TABREF (TOK_TABNAME T3) c) (= (. (TOK_TABLE_OR_COL a) val) (. (TOK_TABLE_OR_COL c) val))) (TOK_TABREF (TOK_TABNAME T4) d) (= (+ (. (TOK_TABLE_OR_COL a) key) 1) (+ (. (TOK_TABLE_OR_COL d) key) 1)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_HINTLIST (TOK_HINT TOK_STREAMTABLE (TOK_HINTARGLIST a))) (TOK_SELEXPR TOK_ALLCOLREF))))' '' 'STAGE DEPENDENCIES:' ' Stage-2 is a root stage' ' Stage-3 depends on stages: Stage-2' ' Stage-1 depends on stages: Stage-3' ' Stage-0 is a root stage' '' 'STAGE PLANS:' ' Stage: Stage-2' ' 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: 1' ' value expressions:' ' expr: key' ' type: string' ' expr: val' ' 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: 0' ' value expressions:' ' expr: key' ' type: string' ' expr: val' ' type: string' ' Reduce Operator Tree:' ' Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {VALUE._col0} {VALUE._col1}' ' 1 {VALUE._col0} {VALUE._col1}' ' handleSkewJoin: false' ' outputColumnNames: _col0, _col1, _col4, _col5' ' 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-3' ' 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: 1' ' value expressions:' ' expr: _col4' ' type: string' ' expr: _col5' ' type: string' ' expr: _col0' ' type: string' ' expr: _col1' ' type: string' ' c ' ' TableScan' ' alias: c' ' Reduce Output Operator' ' key expressions:' ' expr: val' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: val' ' type: string' ' tag: 0' ' value expressions:' ' expr: key' ' type: string' ' expr: val' ' type: string' ' Reduce Operator Tree:' ' Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {VALUE._col0} {VALUE._col1} {VALUE._col4} {VALUE._col5}' ' 1 {VALUE._col0} {VALUE._col1}' ' handleSkewJoin: false' ' outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9' ' File Output Operator' ' compressed: false' ' GlobalTableId: 0' ' table:' ' input format: org.apache.hadoop.mapred.SequenceFileInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat' '' ' Stage: Stage-1' ' Map Reduce' ' Alias -> Map Operator Tree:' ' $INTNAME ' ' Reduce Output Operator' ' key expressions:' ' expr: (_col4 + 1)' ' type: double' ' sort order: +' ' Map-reduce partition columns:' ' expr: (_col4 + 1)' ' type: double' ' tag: 1' ' value expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: string' ' expr: _col8' ' type: string' ' expr: _col9' ' type: string' ' expr: _col4' ' type: string' ' expr: _col5' ' type: string' ' d ' ' TableScan' ' alias: d' ' Reduce Output Operator' ' key expressions:' ' expr: (key + 1)' ' type: double' ' sort order: +' ' Map-reduce partition columns:' ' expr: (key + 1)' ' type: double' ' tag: 0' ' value expressions:' ' expr: key' ' type: string' ' expr: val' ' type: string' ' Reduce Operator Tree:' ' Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {VALUE._col0} {VALUE._col1} {VALUE._col4} {VALUE._col5} {VALUE._col8} {VALUE._col9}' ' 1 {VALUE._col0} {VALUE._col1}' ' handleSkewJoin: false' ' outputColumnNames: _col0, _col1, _col4, _col5, _col8, _col9, _col12, _col13' ' Select Operator' ' expressions:' ' expr: _col8' ' type: string' ' expr: _col9' ' type: string' ' expr: _col0' ' type: string' ' expr: _col1' ' type: string' ' expr: _col4' ' type: string' ' expr: _col5' ' type: string' ' expr: _col12' ' type: string' ' expr: _col13' ' type: string' ' outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7' ' 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' '' 200 rows selected >>> >>> >>> SELECT /*+ STREAMTABLE(a) */ * FROM T1 a JOIN T2 b ON a.key = b.key JOIN T3 c ON a.val = c.val JOIN T4 d ON a.key + 1 = d.key + 1; 'key','val','key','val','key','val','key','val' '2','12','2','22','2','12','2','12' 1 row selected >>> >>> >>> >>> >>> >>> >>> !record