我正在使用的工作区是使用Hive 1.1.0和CDH 5.5.4进行设置的。我做了一个带有22个分区结果的查询。保存在此分区目录中的文件始终是唯一的,可以从20MB变为700MB。如何使用Hive确定HDFS中的文件大小
从我所了解的情况来看,这与查询过程中使用的reducer的数量有关。 Let's假设我想有5个文件,为每个分区,而不是1,我用这个命令:
set mapreduce.job.reduces=5;
这将使系统使用5降低1级任务,但会自动切换到1个减速阶段2(在编译时自动确定)。从我读到的情况来看,这是由于编译器在选择减速器数量时比配置更重要。看起来某些任务不能被“平行”,只能由一个进程或减速任务完成,因此系统会自动确定它。
代码:
insert into table core.pae_ind1 partition (project,ut,year,month)
select ts,date_time, if(
-- m1
code_ac_dcu_m1_d1=0
and (min(case when code_ac_dcu_m1_d1=1 then ts end) over (partition by ut
order by ts rows between 1 following and 1000 following)-ts) <= 15,
min(case when code_ac_dcu_m1_d1=1 then ts end) over (partition by ut order
by ts rows between 1 following and 1000 following)-ts,NULL) as
t_open_dcu_m1_d1,
if(code_ac_dcu_m1_d1=2
and (min(case when code_ac_dcu_m1_d1=3 then ts end) over (partition by ut
order by ts rows between 1 following and 1000 following)-ts) <= 15,
min(case when code_ac_dcu_m1_d1=3 then ts end) over (partition by ut order
by ts rows between 1 following and 1000 following)-ts, NULL) as
t_close_dcu_m1_d1,
project,ut,year,month
from core.pae_open_close
where ut='902'
order by ut,ts
这导致末端具有巨大的文件。我想知道是否有办法将这些结果文件拆分为较小的文件(最好是按大小限制它们)。
'order by ut,ts'? –