Saving all output to "!!{outputDirectory}!!/join33.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/join33.q >>> CREATE TABLE dest_j1(key STRING, value STRING, val2 STRING) STORED AS TEXTFILE; No rows affected >>> >>> EXPLAIN EXTENDED INSERT OVERWRITE TABLE dest_j1 SELECT /*+ MAPJOIN(x) */ x.key, z.value, y.value FROM src1 x JOIN src y ON (x.key = y.key) JOIN srcpart z ON (x.value = z.value and z.ds='2008-04-08' and z.hr=11); 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_JOIN (TOK_TABREF (TOK_TABNAME src1) x) (TOK_TABREF (TOK_TABNAME src) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key))) (TOK_TABREF (TOK_TABNAME srcpart) z) (and (and (= (. (TOK_TABLE_OR_COL x) value) (. (TOK_TABLE_OR_COL z) value)) (= (. (TOK_TABLE_OR_COL z) ds) '2008-04-08')) (= (. (TOK_TABLE_OR_COL z) hr) 11)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_j1))) (TOK_SELECT (TOK_HINTLIST (TOK_HINT TOK_MAPJOIN (TOK_HINTARGLIST x))) (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL z) value)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL y) value)))))' '' 'STAGE DEPENDENCIES:' ' Stage-6 is a root stage' ' Stage-3 depends on stages: Stage-6' ' Stage-1 depends on stages: Stage-3' ' Stage-0 depends on stages: Stage-1' ' Stage-2 depends on stages: Stage-0' '' 'STAGE PLANS:' ' Stage: Stage-6' ' Map Reduce Local Work' ' Alias -> Map Local Tables:' ' x ' ' Fetch Operator' ' limit: -1' ' Alias -> Map Local Operator Tree:' ' x ' ' TableScan' ' alias: x' ' GatherStats: false' ' HashTable Sink Operator' ' condition expressions:' ' 0 {key} {value}' ' 1 {value}' ' handleSkewJoin: false' ' keys:' ' 0 [Column[key]]' ' 1 [Column[key]]' ' Position of Big Table: 1' '' ' Stage: Stage-3' ' Map Reduce' ' Alias -> Map Operator Tree:' ' y ' ' TableScan' ' alias: y' ' GatherStats: false' ' Map Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {key} {value}' ' 1 {value}' ' handleSkewJoin: false' ' keys:' ' 0 [Column[key]]' ' 1 [Column[key]]' ' outputColumnNames: _col0, _col1, _col5' ' Position of Big Table: 1' ' File Output Operator' ' compressed: false' ' GlobalTableId: 0' ' directory: file:!!{hive.exec.scratchdir}!!' ' NumFilesPerFileSink: 1' ' table:' ' input format: org.apache.hadoop.mapred.SequenceFileInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat' ' properties:' ' columns _col0,_col1,_col5' ' columns.types string,string,string' ' escape.delim \' ' TotalFiles: 1' ' GatherStats: false' ' MultiFileSpray: false' ' Local Work:' ' Map Reduce Local Work' ' Needs Tagging: false' ' Path -> Alias:' ' !!{hive.metastore.warehouse.dir}!!/join33.db/src [y]' ' Path -> Partition:' ' !!{hive.metastore.warehouse.dir}!!/join33.db/src ' ' Partition' ' base file name: src' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' properties:' ' bucket_count -1' ' columns key,value' ' columns.types string:string' ' file.inputformat org.apache.hadoop.mapred.TextInputFormat' ' file.outputformat org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' location !!{hive.metastore.warehouse.dir}!!/join33.db/src' ' name join33.src' ' numFiles 1' ' numPartitions 0' ' numRows 0' ' rawDataSize 0' ' serialization.ddl struct src { string key, string value}' ' serialization.format 1' ' serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' totalSize 5812' ' transient_lastDdlTime !!UNIXTIME!!' ' serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' ' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' properties:' ' bucket_count -1' ' columns key,value' ' columns.types string:string' ' file.inputformat org.apache.hadoop.mapred.TextInputFormat' ' file.outputformat org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' location !!{hive.metastore.warehouse.dir}!!/join33.db/src' ' name join33.src' ' numFiles 1' ' numPartitions 0' ' numRows 0' ' rawDataSize 0' ' serialization.ddl struct src { string key, string value}' ' serialization.format 1' ' serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' totalSize 5812' ' transient_lastDdlTime !!UNIXTIME!!' ' serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' name: join33.src' ' name: join33.src' '' ' Stage: Stage-1' ' Map Reduce' ' Alias -> Map Operator Tree:' ' file:!!{hive.exec.scratchdir}!! ' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: string' ' expr: _col5' ' type: string' ' outputColumnNames: _col0, _col1, _col5' ' Reduce Output Operator' ' key expressions:' ' expr: _col1' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: _col1' ' type: string' ' tag: 0' ' value expressions:' ' expr: _col5' ' type: string' ' expr: _col0' ' type: string' ' z ' ' TableScan' ' alias: z' ' GatherStats: false' ' Reduce Output Operator' ' key expressions:' ' expr: value' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: value' ' type: string' ' tag: 1' ' value expressions:' ' expr: value' ' type: string' ' Needs Tagging: true' ' Path -> Alias:' ' file:!!{hive.exec.scratchdir}!! [file:!!{hive.exec.scratchdir}!!]' ' !!{hive.metastore.warehouse.dir}!!/join33.db/srcpart/ds=2008-04-08/hr=11 [z]' ' Path -> Partition:' ' file:!!{hive.exec.scratchdir}!! ' ' Partition' ' base file name: -mr-10002' ' input format: org.apache.hadoop.mapred.SequenceFileInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat' ' properties:' ' columns _col0,_col1,_col5' ' columns.types string,string,string' ' escape.delim \' ' ' ' input format: org.apache.hadoop.mapred.SequenceFileInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat' ' properties:' ' columns _col0,_col1,_col5' ' columns.types string,string,string' ' escape.delim \' ' !!{hive.metastore.warehouse.dir}!!/join33.db/srcpart/ds=2008-04-08/hr=11 ' ' Partition' ' base file name: hr=11' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' partition values:' ' ds 2008-04-08' ' hr 11' ' properties:' ' bucket_count -1' ' columns key,value' ' columns.types string:string' ' file.inputformat org.apache.hadoop.mapred.TextInputFormat' ' file.outputformat org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' location !!{hive.metastore.warehouse.dir}!!/join33.db/srcpart/ds=2008-04-08/hr=11' ' name join33.srcpart' ' numFiles 1' ' numPartitions 4' ' numRows 0' ' partition_columns ds/hr' ' rawDataSize 0' ' serialization.ddl struct srcpart { string key, string value}' ' serialization.format 1' ' serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' totalSize 5812' ' transient_lastDdlTime !!UNIXTIME!!' ' serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' ' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' properties:' ' bucket_count -1' ' columns key,value' ' columns.types string:string' ' file.inputformat org.apache.hadoop.mapred.TextInputFormat' ' file.outputformat org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' location !!{hive.metastore.warehouse.dir}!!/join33.db/srcpart' ' name join33.srcpart' ' numFiles 4' ' numPartitions 4' ' numRows 0' ' partition_columns ds/hr' ' rawDataSize 0' ' serialization.ddl struct srcpart { string key, string value}' ' serialization.format 1' ' serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' totalSize 23248' ' transient_lastDdlTime !!UNIXTIME!!' ' serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' name: join33.srcpart' ' name: join33.srcpart' ' Reduce Operator Tree:' ' Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {VALUE._col1} {VALUE._col4}' ' 1 {VALUE._col1}' ' handleSkewJoin: false' ' outputColumnNames: _col1, _col4, _col9' ' Select Operator' ' expressions:' ' expr: _col4' ' type: string' ' expr: _col9' ' type: string' ' expr: _col1' ' type: string' ' outputColumnNames: _col0, _col1, _col2' ' File Output Operator' ' compressed: false' ' GlobalTableId: 1' ' directory: pfile:!!{hive.exec.scratchdir}!!' ' NumFilesPerFileSink: 1' ' Stats Publishing Key Prefix: pfile:!!{hive.exec.scratchdir}!!' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' properties:' ' bucket_count -1' ' columns key,value,val2' ' columns.types string:string:string' ' file.inputformat org.apache.hadoop.mapred.TextInputFormat' ' file.outputformat org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' location !!{hive.metastore.warehouse.dir}!!/join33.db/dest_j1' ' name join33.dest_j1' ' serialization.ddl struct dest_j1 { string key, string value, string val2}' ' serialization.format 1' ' serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' transient_lastDdlTime !!UNIXTIME!!' ' serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' name: join33.dest_j1' ' TotalFiles: 1' ' GatherStats: true' ' MultiFileSpray: false' '' ' Stage: Stage-0' ' Move Operator' ' tables:' ' replace: true' ' source: pfile:!!{hive.exec.scratchdir}!!' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' properties:' ' bucket_count -1' ' columns key,value,val2' ' columns.types string:string:string' ' file.inputformat org.apache.hadoop.mapred.TextInputFormat' ' file.outputformat org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' location !!{hive.metastore.warehouse.dir}!!/join33.db/dest_j1' ' name join33.dest_j1' ' serialization.ddl struct dest_j1 { string key, string value, string val2}' ' serialization.format 1' ' serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' transient_lastDdlTime !!UNIXTIME!!' ' serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' name: join33.dest_j1' ' tmp directory: pfile:!!{hive.exec.scratchdir}!!' '' ' Stage: Stage-2' ' Stats-Aggr Operator' ' Stats Aggregation Key Prefix: pfile:!!{hive.exec.scratchdir}!!' '' '' 308 rows selected >>> >>> INSERT OVERWRITE TABLE dest_j1 SELECT /*+ MAPJOIN(x) */ x.key, z.value, y.value FROM src1 x JOIN src y ON (x.key = y.key) JOIN srcpart z ON (x.value = z.value and z.ds='2008-04-08' and z.hr=11); 'key','value','value' No rows selected >>> >>> select * from dest_j1 x order by x.key; 'key','value','val2' '146','val_146','val_146' '146','val_146','val_146' '146','val_146','val_146' '146','val_146','val_146' '150','val_150','val_150' '213','val_213','val_213' '213','val_213','val_213' '213','val_213','val_213' '213','val_213','val_213' '238','val_238','val_238' '238','val_238','val_238' '238','val_238','val_238' '238','val_238','val_238' '255','val_255','val_255' '255','val_255','val_255' '255','val_255','val_255' '255','val_255','val_255' '273','val_273','val_273' '273','val_273','val_273' '273','val_273','val_273' '273','val_273','val_273' '273','val_273','val_273' '273','val_273','val_273' '273','val_273','val_273' '273','val_273','val_273' '273','val_273','val_273' '278','val_278','val_278' '278','val_278','val_278' '278','val_278','val_278' '278','val_278','val_278' '311','val_311','val_311' '311','val_311','val_311' '311','val_311','val_311' '311','val_311','val_311' '311','val_311','val_311' '311','val_311','val_311' '311','val_311','val_311' '311','val_311','val_311' '311','val_311','val_311' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '401','val_401','val_401' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '406','val_406','val_406' '66','val_66','val_66' '98','val_98','val_98' '98','val_98','val_98' '98','val_98','val_98' '98','val_98','val_98' 85 rows selected >>> >>> >>> >>> !record