【发布时间】:2015-07-09 12:24:32
【问题描述】:
create table n_data(MARKET string,CATEGORY string,D map<string,string>,monthid int,value DOUBLE)
STORED AS ORC
;
我将数据加载到其中(超过 45000000 行),查看 hive 仓库
结果表由 5 个文件组成,大小为 10MB-20MB,但 dfs.block.size 设置为 128MB,存储小文件不是最佳选择,因为它使用了整个块!
如何将 HIVE 拆分文件设置为 128 MB?
编辑 插入查询:
insert into n_data
select tmp.market,tmp.category,d,adTable.monthid,tmp.factperiod[adTable.monthid] as fact
from (select market,category,d,factperiod,map_keys(factperiod) as month_arr from n_src where market is not null) as tmp
LATERAL VIEW explode(month_arr) adTable AS monthid
【问题讨论】:
-
如何插入记录,显示插入语句。您还有其他与 hive 设置相关的属性吗?
-
@Ambrish 我在问题中添加了插入查询
-
@Ambrish 不,我没有其他与 hive 设置相关的内容
-
insert into 将在每次运行时创建新文件。因此,如果您批量运行您的工具,那么您将看到至少 BATCH_COUNT 个文件。
-
@Ambrish,我只运行插入,加载事实时,它不会在批处理模式下运行