备忘
详细请移步我们组小伙伴博客
hive里面select count(*)为0,select * 有数据
背景
Hive 中 A 表存在数据, 但执行 select count(*) from A
返回结果为 0
原因
参数 hive.compute.query.using.stats
默认为 false
, 在参数优化时修改为 true
导致上述问题产生
解决
使用 select count(*) / count(1) ...
查询数据量时, 临时将参数设置为 false (窗口级别)
set hive.compute.query.using.stats=false;
select count(*) from A;