簡體   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