Bethlee
Bethlee

Reputation: 945

How can I estimate a table size in HIVE without query?

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)

I calculated table size like this.

Would you give me some advice?

Upvotes: 2

Views: 3426

Answers (2)

David דודו Markovitz
David דודו Markovitz

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

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

Related Questions