[跪求跪求] Hive Left Join操作BUG

DV2 DV2 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
执行语句:
select t.cookie,
t.datetime,
t.province,
t.city,
t.ostype,
t.ip,
c.cookie,
if(c.cookie is null,1,0) as new_old_user
from log_test t
left join cookie_dw c
on (t.cookie = c.cookie)
where t.cookie='1234567==';

输出结果:

说明:
我的log_test是一个小表:记录数几十万(外部分区表),cookoe_dw表是一个大字典表几千万(内部表)。
如果我把c表中记录cookie='1234567=='先存到一个临时表然后临时表和log_test做上面join操作正常。
使用Hive版本:0.14
执行计划:
STAGE DEPENDENCIES:
Stage-4 is a root stage , consists of Stage-1
Stage-1
Stage-0 depends on stages: Stage-1

STAGE PLANS:
Stage: Stage-4
Conditional Operator

Stage: Stage-1
Map Reduce
Map Operator Tree:
TableScan
alias: t
Statistics: Num rows: 272329 Data size: 115467908 Basic stats: COMPLETE Column stats: NONE
Filter Operator
predicate: (cookie = '1234567==') (type: boolean)
Statistics: Num rows: 136164 Data size: 57733741 Basic stats: COMPLETE Column stats: NONE
Reduce Output Operator
key expressions: '1234567==' (type: string)
sort order: +
Statistics: Num rows: 136164 Data size: 57733741 Basic stats: COMPLETE Column stats: NONE
value expressions: ip (type: string), province (type: string), city (type: string), ostype (type: string)
TableScan
alias: c
Statistics: Num rows: 25907492 Data size: 1661921211 Basic stats: COMPLETE Column stats: NONE
Filter Operator
predicate: (cookie = '1234567==') (type: boolean)
Statistics: Num rows: 12953746 Data size: 830960605 Basic stats: COMPLETE Column stats: NONE
Reduce Output Operator
key expressions: cookie (type: string)
sort order: +
Map-reduce partition columns: cookie (type: string)
Statistics: Num rows: 12953746 Data size: 830960605 Basic stats: COMPLETE Column stats: NONE
Reduce Operator Tree:
Join Operator
condition map:
Left Outer Join0 to 1
condition expressions:
0 {VALUE._col1} {VALUE._col2} {VALUE._col3} {VALUE._col23}
1 {KEY.reducesinkkey0}
outputColumnNames: _col2, _col3, _col4, _col24, _col30
Statistics: Num rows: 14249120 Data size: 914056685 Basic stats: COMPLETE Column stats: NONE
Select Operator
expressions: '1234567==' (type: string), _col3 (type: string), _col4 (type: string), _col24 (type: string), _col2 (type: string), _col30 (type: string), if(_col30 is null, 1, 0) (type: int)
outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6
Statistics: Num rows: 14249120 Data size: 914056685 Basic stats: COMPLETE Column stats: NONE
File Output Operator
compressed: false
Statistics: Num rows: 14249120 Data size: 914056685 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-0
Fetch Operator
limit: -1
Processor Tree:
ListSink

Time taken: 0.503 seconds, Fetched: 61 row(s)
...全文
评论 10
收藏 已收藏
分享
返回顶部
DV2
Hadoop生态社区 20,842 成员 4,695 内容