Skip to main content
ateka_18
Silver ⭐️⭐️
November 6, 2020
Solved

How to check the size of Hive view table?

Hello,

 

I am unable to know the size of the hive table. Actually it is a view specifically which we wanted to know the size of.

 

I have tried by running commands such as hdfs dfs -du -s -h /path/to/table, but the view can't be found in the location.

 

beeline> describe formatted/extended table name; Also does not give the output 

 

I also tried with ANALYZE but no output as well.

 

Can some one tell me how to know the size of the view table. Since we have created view of the different table in database. 

 

And we want to know the size of the particular table.

tusharkathpal
Gold ⭐️
November 9, 2020

@ateka_18 

 

As mentioned before as well, view is just a query statement in HMS. It's not actually a table. If you want to know the size of the table, below is the best approach.

 

hdfs dfs -du -s -h /path/to/table

 

Let's say you have a table named test(/user/hive/warehouse/default.db/test) and have several partitions under it (part1, part2, part3). To get the size of the table.

 

hdfs dfs -du -s -h /user/hive/warehouse/default.db/test

 

Let me know if the above helps.

6 replies

HanzalaShaikh
Gold ⭐️
November 7, 2020

Hi Ateka,

 

Can you share what error you are getting. while submitting the command to better understand the issue.

Translate
ateka_18
ateka_18Author
Silver ⭐️⭐️
November 7, 2020

these is the error I got:

 

Error: Error while compiling statement: FAILED: SemanticException [Error 10091]: ANALYZE is not supported for views (state=42000,code=10091)
 
Please suggest any other command for views. 
Translate
tusharkathpal
Gold ⭐️
Gold ⭐️
November 7, 2020

@ateka_18 

 

VIEW is just a query statement saved in HMS. So basically its the size of the table you gather and to do so, the best option is below.

 

hdfs dfs -ls <path of the table>

 

With regards to the error you are observing, it clearly says that analyze table is not supported for views. You can get the same for tables.

Translate