Skip to content

Instantly share code, notes, and snippets.

@kgs
Created December 17, 2014 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kgs/399ad7ca2c481bd2c018 to your computer and use it in GitHub Desktop.
Save kgs/399ad7ca2c481bd2c018 to your computer and use it in GitHub Desktop.
explain_good
set hive.auto.convert.join=false;
explain select log.id, log.dest_id, com1.msgs, com2.msgs from kgorlo_log log
. . . . . . . . . . . . . . . . . . . . . . > left outer join (select id, dest_id, count(*) as msgs from kgorlo_comm group by id, dest_id)com1 on com1.id=log.id and com1.dest_id=log.dest_id
. . . . . . . . . . . . . . . . . . . . . . > left outer join (select id, dest_id, count(*) as msgs from kgorlo_comm group by id, dest_id)com2 on com2.dest_id=log.id and com2.id=log.dest_id;
+-------------------------------------------------------------------------------------------------------------------+--+
| Explain |
+-------------------------------------------------------------------------------------------------------------------+--+
| STAGE DEPENDENCIES: |
| Stage-1 is a root stage |
| Stage-2 depends on stages: Stage-1, Stage-3 |
| Stage-3 is a root stage |
| Stage-0 is a root stage |
| |
| STAGE PLANS: |
| Stage: Stage-1 |
| Map Reduce |
| Map Operator Tree: |
| TableScan |
| alias: kgorlo_comm |
| Statistics: Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE |
| Select Operator |
| expressions: id (type: bigint), dest_id (type: bigint) |
| outputColumnNames: id, dest_id |
| Statistics: Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE |
| Group By Operator |
| aggregations: count() |
| keys: id (type: bigint), dest_id (type: bigint) |
| mode: hash |
| outputColumnNames: _col0, _col1, _col2 |
| Statistics: Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE |
| Reduce Output Operator |
| key expressions: _col0 (type: bigint), _col1 (type: bigint) |
| sort order: ++ |
| Map-reduce partition columns: _col0 (type: bigint), _col1 (type: bigint) |
| Statistics: Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE |
| value expressions: _col2 (type: bigint) |
| Reduce Operator Tree: |
| Group By Operator |
| aggregations: count(VALUE._col0) |
| keys: KEY._col0 (type: bigint), KEY._col1 (type: bigint) |
| mode: mergepartial |
| outputColumnNames: _col0, _col1, _col2 |
| Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE |
| Select Operator |
| expressions: _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint) |
| outputColumnNames: _col0, _col1, _col2 |
| Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE |
| File Output Operator |
| compressed: false |
| table: |
| input format: org.apache.hadoop.mapred.SequenceFileInputFormat |
| output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat |
| serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe |
| |
| Stage: Stage-2 |
| Map Reduce |
| Map Operator Tree: |
| TableScan |
| Reduce Output Operator |
| key expressions: _col1 (type: bigint), _col0 (type: bigint) |
| sort order: ++ |
| Map-reduce partition columns: _col1 (type: bigint), _col0 (type: bigint) |
| Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE |
| value expressions: _col2 (type: bigint) |
| TableScan |
| Reduce Output Operator |
| key expressions: _col0 (type: bigint), _col1 (type: bigint) |
| sort order: ++ |
| Map-reduce partition columns: _col0 (type: bigint), _col1 (type: bigint) |
| Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE |
| value expressions: _col2 (type: bigint) |
| TableScan |
| alias: log |
| Statistics: Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE |
| Reduce Output Operator |
| key expressions: id (type: bigint), dest_id (type: bigint) |
| sort order: ++ |
| Map-reduce partition columns: id (type: bigint), dest_id (type: bigint) |
| Statistics: Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE |
| value expressions: id (type: bigint), dest_id (type: bigint) |
| Reduce Operator Tree: |
| Join Operator |
| condition map: |
| Left Outer Join0 to 1 |
| Left Outer Join0 to 2 |
| condition expressions: |
| 0 {VALUE._col0} {VALUE._col1} |
| 1 {VALUE._col2} |
| 2 {VALUE._col2} |
| outputColumnNames: _col0, _col1, _col7, _col10 |
| Statistics: Num rows: 2 Data size: 52 Basic stats: COMPLETE Column stats: NONE |
| Select Operator |
| expressions: _col0 (type: bigint), _col1 (type: bigint), _col7 (type: bigint), _col10 (type: bigint) |
| outputColumnNames: _col0, _col1, _col2, _col3 |
| Statistics: Num rows: 2 Data size: 52 Basic stats: COMPLETE Column stats: NONE |
| File Output Operator |
| compressed: false |
| Statistics: Num rows: 2 Data size: 52 Basic stats: COMPLETE Column stats: NONE |
| table: |
| input format: org.apache.hadoop.mapred.TextInputFormat |
| output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat |
| serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe |
| |
| Stage: Stage-3 |
| Map Reduce |
| Map Operator Tree: |
| TableScan |
+-------------------------------------------------------------------------------------------------------------------+--+
| Explain |
+-------------------------------------------------------------------------------------------------------------------+--+
| alias: kgorlo_comm |
| Statistics: Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE |
| Select Operator |
| expressions: id (type: bigint), dest_id (type: bigint) |
| outputColumnNames: id, dest_id |
| Statistics: Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE |
| Group By Operator |
| aggregations: count() |
| keys: id (type: bigint), dest_id (type: bigint) |
| mode: hash |
| outputColumnNames: _col0, _col1, _col2 |
| Statistics: Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE |
| Reduce Output Operator |
| key expressions: _col0 (type: bigint), _col1 (type: bigint) |
| sort order: ++ |
| Map-reduce partition columns: _col0 (type: bigint), _col1 (type: bigint) |
| Statistics: Num rows: 1 Data size: 24 Basic stats: COMPLETE Column stats: NONE |
| value expressions: _col2 (type: bigint) |
| Reduce Operator Tree: |
| Group By Operator |
| aggregations: count(VALUE._col0) |
| keys: KEY._col0 (type: bigint), KEY._col1 (type: bigint) |
| mode: mergepartial |
| outputColumnNames: _col0, _col1, _col2 |
| Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE |
| Select Operator |
| expressions: _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint) |
| outputColumnNames: _col0, _col1, _col2 |
| Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE |
| File Output Operator |
| compressed: false |
| table: |
| input format: org.apache.hadoop.mapred.SequenceFileInputFormat |
| output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat |
| serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe |
| |
| Stage: Stage-0 |
| Fetch Operator |
| limit: -1 |
| |
+-------------------------------------------------------------------------------------------------------------------+--+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment