开发者社区> 问答> 正文

hive表有数据,但count(*)返回0

已解决

hive select 有数据,但是select count() 返回为0

展开
收起
寒沙牧 2018-09-04 16:07:39 5803 0
2 条回答
写回答
取消 提交回答
  • 擅长互联网移动开发。。。
    采纳回答

    高速查询hive数据仓库中的条数。在查询hive表的条数,通常使用count()。可是数据量大的时候,mr跑count()往往须要几分钟的时间。
    参考这篇帮助文章:https://www.cnblogs.com/claireyuancy/p/6811390.html

    2019-07-17 23:03:34
    赞同 展开评论 打赏
  • set hive.compute.query.using.stats=false ; 然后再跑一下。

        "When set to true Hive will answer a few queries like count(1) purely using stats\n" +
        "stored in metastore. For basic stats collection turn on the config hive.stats.autogather to true.\n" +
        "For more advanced stats collection need to run analyze table queries."
    

    这个比较hack了

    2019-07-17 23:03:34
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Comparison of Spark SQL with Hive 立即下载
spark替代HIVE实现ETL作业 立即下载
Hive Bucketing in Apache Spark 立即下载