配置单元查询以快速查找表大小(行数) [英] Hive query to quickly find table size (number of rows)

查看:80
本文介绍了配置单元查询以快速查找表大小(行数)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个Hive查询来快速查找表大小(即行数)而无需启动耗时的MapReduce作业? (这就是为什么我要避免使用COUNT(*)的原因.)

Is there a Hive query to quickly find table size (i.e. number of rows) without launching a time-consuming MapReduce job? (Which is why I want to avoid COUNT(*).)

我尝试了DESCRIBE EXTENDED,但是生成了numRows=0,这显然是不正确的.

I tried DESCRIBE EXTENDED, but that yielded numRows=0 which is obviously not correct.

(对newb问题的道歉.我尝试使用Google搜索并搜索apache.org文档,但未成功.)

(Apologies for the newb question. I tried Googling and searching the apache.org documentation without success.)

推荐答案

tblproperties将提供表的大小,并在需要时可用于仅获取该值.

tblproperties will give the size of the table and can be used to grab just that value if needed.

-- gives all properties
show tblproperties yourTableName

-- show just the raw data size
show tblproperties yourTableName("rawDataSize")

这篇关于配置单元查询以快速查找表大小(行数)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆