Hive原始文件1421M,按snappy压缩之后结果:
|
|
|
|
| select count(*) from table | select count(*) from (select key from table where key='') a; |
|
file type | table name | row number | Map个数 | File Size(M) | count(*) (S) | count(key) (S) | HDFS Read |
text | test_text2 | 58336344 | 7 | 852.2 | 29.8 | 29.9 | 852.2 |
sequence | test_sequence | 58336344 | 4 | 906.1 | 42.6 | 41.9 | 916.4 |
rcfile | test_rc | 58336344 | 4 | 826.8 | 34 | 34.4 | 754.3 |
avro | test_avro2 | 58336344 | 3 | 590.9 | 75.8 | 90.7 | 591 |
Hadoop Cluster Network Usage:
Hadoop Cluster CPU Usage:
结论:
- RCFile在读速度是最高的。
- AVRO File最占用CPU。
- RCFile HDFS read在输入一样的情况下会比较低。
-
AVRO file hive表不支持增加列(例子:alter table test_avro add columns(x int)),其他都是支持的。
- AVRO压缩效果最好(压缩使用的CPU最多)。