美文网首页编程学习
Hive关于select count(*) 有数据,而selec

Hive关于select count(*) 有数据,而selec

作者: Bloo_m | 来源:发表于2016-12-26 15:49 被阅读36次

问题:
工作中遇到了select count(*) from tab_name可以得出数据,但select * from tab_name没有数据,如图所示

Paste_Image.png

本人的原因是因为location的文件不存在所导致的,其中select * from tab_name 是从Hive数据库中直接执行的,而select count(*) from tab_name 是通过MR(MapReduce)执行的
解决办法:show create table tab_name进行查看

相关文章

网友评论

    本文标题:Hive关于select count(*) 有数据,而selec

    本文链接:https://www.haomeiwen.com/subject/mjbjvttx.html