配置单元-每个分区输出多个文件

rseugnpd  于 2021-06-26  发布在  Hive
关注(0)|答案(0)|浏览(287)

我正在尝试生成一组压缩的csv文件,这些文件可以被集群上运行的spark脚本提取和处理。因此,我希望将数据拆分为多个部分,以便下游处理可以跨集群的节点并行化。目前,无论我设置了什么选项,hive都会输出单个大文件,每个分区~1gb。这大大减慢了spark中后期的操作。如何设置它以使hive创建多个较小的文件而不是单个较大的文件?

CREATE EXTERNAL TABLE IF NOT EXISTS model_sample (
<fields>
)
partitioned by (market string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '|'
STORED AS TEXTFILE
LOCATION 's3://...';

set hive.exec.dynamic.partition.mode=nonstrict;
set hive.exec.compress.output=true;
set mapred.output.compression.codec=org.apache.hadoop.io.compress.GzipCodec;

set hive.merge.tezfiles=false;
set hive.merge.mapfiles=false;
set hive.merge.mapredfiles=false;
set mapred.max.split.size=68157440;
set mapred.min.split.size=68157440;
set hive.merge.smallfiles.avgsize=128000000;

insert overwrite table model_sample partition(market)(
    select * from ...
);

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题