[英]How can I estimate a table size in HIVE without query?
我想在不查詢HIVE的情況下計算表大小。
我如何在HIVE中做到這一點? (我沒有在數據庫中選擇的任何權限,所以我不能使用show屬性等)
(例如)
dataRows:100
columnName(Type):userName(字符串),userNumber(int),userCode(bigint),userAge(int)
我這樣計算表的大小。
我認為該字符串是8bytes,int是4bytes,bigint是8bytes(我沒有考慮記錄頭大小和列頭大小)
你能給我一些建議嗎?
hdfs dfs -du -s {table locatoin}
(可選-h)
例如
hdfs dfs -du -s /user/hive/warehouse/mytable
110265307244 /user/hive/warehouse/mytable
hdfs dfs -du -s -h /user/hive/warehouse/mytable
102.7 G /user/hive/warehouse/mytable
如果您無法訪問Hive或HDFS,則實際上是不可能的。
Hive可能使用不同的壓縮機制,這也可能影響HDFS上原始數據的大小。 如果將其存儲為純文本格式,則可以使用它,但是我不會說這是最好的方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.