hadoop查看hive表
时间: 2023-08-19 14:12:49 浏览: 139
Hadoop可以通过一行脚本来查看Hive表的大小。具体命令如下:
```
hadoop fs -ls /user/hive/warehouse/数据库名.db/表名|awk -F ' ' '{print $5}'|awk '{a+=$1}END{print a}'
```
这个命令会列出Hive表的文件列表,并计算出文件的总大小(单位为字节)。如果你想将大小转换为GB,可以使用以下命令:
```
hadoop fs -ls /user/hive/warehouse/数据库名.db/表名|awk -F ' ' '{print $5}'|awk '{a+=$1}END{print a/(1024*1024*1024)}'
```
这样就可以得到Hive表的大小了。\[1\] \[3\]
#### 引用[.reference_title]
- *1* *2* [Hive查看表大小(所占的磁盘空间大小)](https://blog.csdn.net/iiiitttttt/article/details/123736254)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [查看Hive表信息及占用空间的方法](https://blog.csdn.net/BabyFish13/article/details/52055927)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文