【发布时间】:2016-10-07 08:27:19
【问题描述】:
我目前正在使用 Hive 进行一些数据探索,但无法解释以下行为。假设我有一个带有 master_id 字段的表(名为 mytable)。
当我计算得到的行数时
select count(*) as c from mytable
c
1129563
如果我想计算具有非空 master_id 的行数,我会得到更大的数字
select count(*) as c from mytable where master_id is not null
c
1134041
此外,master_id 似乎永远不会为空。
select count(*) as c from mytable where master_id is null
c
0
我无法解释如何添加 where 语句最终会增加行数。有没有人有任何提示来解释这种行为?
谢谢
【问题讨论】:
-
该表的架构是什么样的?
-
提供您的表架构
标签: sql hive hiveql hive-configuration