2、小文件问题解决

避免mapper开启过多,导致导致的资源错配,

  1、hive小文件问题

  2、mr编程小文件问题

1、hive中的小文件问题

通过shell,产生100个小文件,目录 one100

[centos@s101 ~/one00]$ for((x=1;x<=100;x+=1)); do echo $x,tom$x,$x > $x.txt; done

建表

create table one100(id int,name string,age int)row format delimited fields terminated by ',';

load数据到表one100中

load data local inpath 'one00/*' into table one100;

配置:

set mapred.max.split.size;

默认256000000,

猜你喜欢

转载自www.cnblogs.com/lybpy/p/9710643.html