如何计算配置单元中一条记录的大小? [英] How to calculate size of the one record in hive?
本文介绍了如何计算配置单元中一条记录的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要了解我的表将使用多少内存.我知道记录的算术平均值.我知道有哪些类型的记录.但我无法理解如何计算记录的平均/最大大小.如果我获得每列记录的平均/最大大小,是否可以计算它?
I need to understand how much memory my table will use. I know the arithmetic mean of records. I know what types of records have. But I can't understand how to calculate mean/max size of the record. Is this possible to calculate it if I get mean/max size of every column of record?
推荐答案
获取每列的平均/最大大小
get mean/max size of every column
您还可以分析表格并获取列的统计信息.
Also you can analyze table and fetch stats for column.
分析表:
ANALYZE TABLE tablename COMPUTE STATISTICS FOR COLUMNS;
使用描述格式:
desc formatted tablename column_name
它将打印这些数字:
data_type, min, max, num_nulls, distinct_count, avg_col_len, max_col_len, num_trues, num_falses
不幸的是,它一次只适用于一列,您需要重复 describe 命令来获取所有列的统计信息.
Unfortunately, it works for single column at a time and you need to repeat describe command to get all columns stats.
这篇关于如何计算配置单元中一条记录的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文