[跪求跪求] Hive Left Join操作BUG
执行语句:
输出结果:

说明:
我的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)
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)
...全文
相关推荐
Hive查询sql left join exists
在Hive SQL中,JOIN操作是用来合并来自两个或多个表的数据。
hive sql + left join 数据缺失
随着Hive版本的不断更新,部分用户在升级至Hive 3之后遇到了数据处理中的一个常见问题——在执行Left Join操作时出现数据缺失。
inner join、 left join 、right join、 outer join之间的区别
### inner join、left join、right join、outer join之间的区别在数据库操作中,连接(Join)是一种非常重要的操作,用于组合两个或多个表中的数据。
SQL left join
SQL Left Join SQLLeft Join是一种常用的数据库查询操作,它可以将两个或多个表格中的数据结合起来,以便更好地分析和处理数据。
(Left join , Right Join, Inner Join)用法详解
### (Left join , Right Join, Inner Join)用法详解#### 一、基本概念与应用场景在数据库查询语言SQL中,连接(Join)是一种非常重要的操作,它允许我们结合两个或多个表的数据来检索信息


