Reputation: 945
I want to calculate the table size without querying in HIVE.
How can I do this in HIVE? (I don't have any permission without selecting in database so I can't use show properties, etc)
(For example)
dataRows : 100
columnName(Type) : userName(string), userNumber(int), userCode(bigint), userAge(int)
I calculated table size like this.
I thought like that string is 8bytes, int is 4bytes, bigint is 8bytes (I didn't consider about record header size and column header size)
Would you give me some advice?
Upvotes: 2
Views: 3426
Reputation: 44951
hdfs dfs -du -s {table locatoin}
(optional -h)
E.g.
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
Upvotes: 2
Reputation: 879
This is not really possible if you have no access to Hive or HDFS.
Hive could be using different compression mechanisms and that could impact the size of the raw data on HDFS as well. If its stored in plain text, you could potentially use this, but I wouldnt say thats the best way to do this.
Upvotes: 1