Saving all output to "!!{outputDirectory}!!/join_hive_626.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/join_hive_626.q >>> >>> >>> >>> >>> create table hive_foo (foo_id int, foo_name string, foo_a string, foo_b string, foo_c string, foo_d string) row format delimited fields terminated by ',' stored as textfile; No rows affected >>> >>> create table hive_bar (bar_id int, bar_0 int, foo_id int, bar_1 int, bar_name string, bar_a string, bar_b string, bar_c string, bar_d string) row format delimited fields terminated by ',' stored as textfile; No rows affected >>> >>> create table hive_count (bar_id int, n int) row format delimited fields terminated by ',' stored as textfile; No rows affected >>> >>> load data local inpath '../data/files/hive_626_foo.txt' overwrite into table hive_foo; No rows affected >>> load data local inpath '../data/files/hive_626_bar.txt' overwrite into table hive_bar; No rows affected >>> load data local inpath '../data/files/hive_626_count.txt' overwrite into table hive_count; No rows affected >>> >>> explain select hive_foo.foo_name, hive_bar.bar_name, n from hive_foo join hive_bar on hive_foo.foo_id = hive_bar.foo_id join hive_count on hive_count.bar_id = hive_bar.bar_id; 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME hive_foo)) (TOK_TABREF (TOK_TABNAME hive_bar)) (= (. (TOK_TABLE_OR_COL hive_foo) foo_id) (. (TOK_TABLE_OR_COL hive_bar) foo_id))) (TOK_TABREF (TOK_TABNAME hive_count)) (= (. (TOK_TABLE_OR_COL hive_count) bar_id) (. (TOK_TABLE_OR_COL hive_bar) bar_id)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL hive_foo) foo_name)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL hive_bar) bar_name)) (TOK_SELEXPR (TOK_TABLE_OR_COL n)))))' '' 'STAGE DEPENDENCIES:' ' Stage-1 is a root stage' ' Stage-2 depends on stages: Stage-1' ' Stage-0 is a root stage' '' 'STAGE PLANS:' ' Stage: Stage-1' ' Map Reduce' ' Alias -> Map Operator Tree:' ' hive_bar ' ' TableScan' ' alias: hive_bar' ' Reduce Output Operator' ' key expressions:' ' expr: foo_id' ' type: int' ' sort order: +' ' Map-reduce partition columns:' ' expr: foo_id' ' type: int' ' tag: 1' ' value expressions:' ' expr: bar_id' ' type: int' ' expr: bar_name' ' type: string' ' hive_foo ' ' TableScan' ' alias: hive_foo' ' Reduce Output Operator' ' key expressions:' ' expr: foo_id' ' type: int' ' sort order: +' ' Map-reduce partition columns:' ' expr: foo_id' ' type: int' ' tag: 0' ' value expressions:' ' expr: foo_name' ' type: string' ' Reduce Operator Tree:' ' Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {VALUE._col1}' ' 1 {VALUE._col0} {VALUE._col4}' ' handleSkewJoin: false' ' outputColumnNames: _col1, _col8, _col12' ' File Output Operator' ' compressed: false' ' GlobalTableId: 0' ' table:' ' input format: org.apache.hadoop.mapred.SequenceFileInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat' '' ' Stage: Stage-2' ' Map Reduce' ' Alias -> Map Operator Tree:' ' $INTNAME ' ' Reduce Output Operator' ' key expressions:' ' expr: _col8' ' type: int' ' sort order: +' ' Map-reduce partition columns:' ' expr: _col8' ' type: int' ' tag: 0' ' value expressions:' ' expr: _col1' ' type: string' ' expr: _col12' ' type: string' ' hive_count ' ' TableScan' ' alias: hive_count' ' Reduce Output Operator' ' key expressions:' ' expr: bar_id' ' type: int' ' sort order: +' ' Map-reduce partition columns:' ' expr: bar_id' ' type: int' ' tag: 1' ' value expressions:' ' expr: n' ' type: int' ' Reduce Operator Tree:' ' Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {VALUE._col1} {VALUE._col12}' ' 1 {VALUE._col1}' ' handleSkewJoin: false' ' outputColumnNames: _col1, _col12, _col20' ' Select Operator' ' expressions:' ' expr: _col1' ' type: string' ' expr: _col12' ' type: string' ' expr: _col20' ' type: int' ' outputColumnNames: _col0, _col1, _col2' ' File Output Operator' ' compressed: false' ' GlobalTableId: 0' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' '' ' Stage: Stage-0' ' Fetch Operator' ' limit: -1' '' '' 123 rows selected >>> >>> select hive_foo.foo_name, hive_bar.bar_name, n from hive_foo join hive_bar on hive_foo.foo_id = hive_bar.foo_id join hive_count on hive_count.bar_id = hive_bar.bar_id; 'foo_name','bar_name','n' 'foo1','bar10','2' 1 row selected >>> >>> >>> >>> >>> >>> !record