Saving all output to "!!{outputDirectory}!!/join_view.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/join_view.q >>> drop table invites; No rows affected >>> drop table invites2; No rows affected >>> create table invites (foo int, bar string) partitioned by (ds string); No rows affected >>> create table invites2 (foo int, bar string) partitioned by (ds string); No rows affected >>> >>> set hive.mapred.mode=strict; No rows affected >>> >>> -- test join views: see HIVE-1989 >>> >>> create view v as select invites.bar, invites2.foo, invites2.ds from invites join invites2 on invites.ds=invites2.ds; 'bar','foo','ds' No rows selected >>> >>> explain select * from v where ds='2011-09-01'; 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME v))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_WHERE (= (TOK_TABLE_OR_COL ds) '2011-09-01'))))' '' '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:' ' v:invites ' ' TableScan' ' alias: invites' ' Filter Operator' ' predicate:' ' expr: (ds = '2011-09-01')' ' type: boolean' ' Reduce Output Operator' ' key expressions:' ' expr: ds' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: ds' ' type: string' ' tag: 0' ' value expressions:' ' expr: bar' ' type: string' ' v:invites2 ' ' TableScan' ' alias: invites2' ' Filter Operator' ' predicate:' ' expr: (ds = '2011-09-01')' ' type: boolean' ' Reduce Output Operator' ' key expressions:' ' expr: ds' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: ds' ' type: string' ' tag: 1' ' value expressions:' ' expr: foo' ' type: int' ' expr: ds' ' type: string' ' Reduce Operator Tree:' ' Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {VALUE._col1}' ' 1 {VALUE._col0} {VALUE._col2}' ' handleSkewJoin: false' ' outputColumnNames: _col1, _col5, _col7' ' Select Operator' ' expressions:' ' expr: _col1' ' type: string' ' expr: _col5' ' type: int' ' expr: _col7' ' type: string' ' outputColumnNames: _col0, _col1, _col2' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: int' ' expr: _col2' ' type: string' ' outputColumnNames: _col0, _col1, _col2' ' File Output Operator' ' compressed: false' ' GlobalTableId: 0' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' '' ' Stage: Stage-0' ' Fetch Operator' ' limit: -1' '' '' 90 rows selected >>> >>> drop view v; No rows affected >>> drop table invites; No rows affected >>> drop table invites2; No rows affected >>> !record