- 对于一下两种join方式,执行计划结果是一致的,都是只有一个MR
explain select * from tb1 t1
LEFT JOIN tb2 t2 ON t1.name = t2.name
LEFT JOIN tb3 t3 ON t2.name = t3.name;
explain select * from tb1 t1
LEFT JOIN tb2 t2 ON t1.name = t2.name
LEFT JOIN tb3 t3 ON t1.name = t3.name;
STAGE DEPENDENCIES:
Stage-5 is a root stage
Stage-4 depends on stages: Stage-5
Stage-0 depends on stages: Stage-4
STAGE PLANS:
Stage: Stage-5
Map Reduce Local Work
Alias -> Map Local Tables:
t2
Fetch Operator
limit: -1
t3
Fetch Operator
limit: -1
Alias -> Map Local Operator Tree:
t2
TableScan
alias: t2
Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
HashTable Sink Operator
keys:
0 name (type: string)
1 name (type: string)
2 name (type: string)
t3
TableScan
alias: t3
Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
HashTable Sink Operator
keys:
0 name (type: string)
1 name (type: string)
2 name (type: string)
Stage: Stage-4
Map Reduce
Map Operator Tree:
TableScan
alias: t1
Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
Map Join Operator
condition map:
Left Outer Join0 to 1
Left Outer Join1 to 2
keys:
0 name (type: string)
1 name (type: string)
2 name (type: string)
outputColumnNames: _col0, _col1, _col5, _col6, _col10, _col11
Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL Column stats: NONE
Select Operator
expressions: _col0 (type: int), _col1 (type: string), _col5 (type: int), _col6 (type: string), _col10 (type: int), _col11 (type: string)
outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL Column stats: NONE
File Output Operator
compressed: false
Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL Column stats: NONE
table:
input format: org.apache.hadoop.mapred.SequenceFileInputFormat
output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
Local Work:
Map Reduce Local Work
Stage: Stage-0
Fetch Operator
limit: -1
Processor Tree:
ListSink