RCFile SequenceFile and Avro comparison Test

来源:互联网 发布:小米5x网络制式 编辑:程序博客网 时间:2024/06/05 19:41

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:

结论:

  1. RCFile在读速度是最高的。
  2. AVRO File最占用CPU。
  3. RCFile HDFS read在输入一样的情况下会比较低。
  4. AVRO file hive表不支持增加列(例子:alter table test_avro add columns(x int)),其他都是支持的。

  5. AVRO压缩效果最好(压缩使用的CPU最多)。