- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to check the size of Hive view table?
- Labels:
-
Apache Hive
Created ‎11-06-2020 07:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎11-08-2020 07:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎11-07-2020 12:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ateka,
Can you share what error you are getting. while submitting the command to better understand the issue.
Created ‎11-07-2020 05:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
these is the error I got:
Created ‎11-07-2020 07:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎11-08-2020 06:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the explanation.
Are you sure there is no other way to know the size of the view table.
I tried with hdfs dfs -ls command but we have tables in partition so not able to locate the exact table.
I can check the size by running hdfs dfs -du -s -h on the path on different directories and sub directories.
A quick reply will be highly appreciated.
Created ‎11-08-2020 07:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎11-14-2020 07:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot @tusharkathpal for your detailed explanation. Your suggestion has really worked.
