繁体   English   中英

如何调整 Hive 插入覆盖分区?

[英]How to Tune Hive Insert overwrite partition?

我在 hive 中编写了插入覆盖分区以将分区中的所有文件合并到更大的文件中,

查询语句:

SET hive.exec.compress.output=true;
set hive.merge.smallfiles.avgsize=2560000000;
set hive.merge.mapredfiles=true;
set hive.merge.mapfiles =true;
SET mapreduce.max.split.size=256000000;
SET mapreduce.min.split.size=256000000;
SET mapreduce.output.fileoutputformat.compress.type =BLOCK;
SET hive.hadoop.supports.splittable.combineinputformat=true;
SET mapreduce.output.fileoutputformat.compress.codec=${v_compression_codec};

INSERT OVERWRITE TABLE ${source_database}.${table_name} PARTITION (${line}) \n SELECT ${prepare_sel_columns} \n from ${source_database}.${table_name} \n WHERE ${partition_where_clause};\n" 

通过上述设置,我得到了压缩输出,但生成输出文件所需的时间太长。

即使它只运行 map 作业,也需要很多时间。

从配置单元寻找任何进一步的设置来调整插入以更快地运行。

指标。

15 GB 文件 ==> 需要 10 分钟。

SET hive.exec.compress.output=true; SET mapreduce.input.fileinputformat.split.minsize=512000000; SET mapreduce.input.fileinputformat.split.maxsize=5120000000; SET mapreduce.output.fileoutputformat.compress.type =BLOCK; SET hive.hadoop.supports.splittable.combineinputformat=true; SET mapreduce.output.fileoutputformat.compress.codec=${v_compression_codec};

上述设置帮助很大,持续时间从 10 分钟减少到 1 分钟。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM