默认配置为:
<property>
<name>hive.exec.parallel</name>
<value>false</value>
<description>Whether to execute jobs in parallel</description>
</property>
<property>
<name>hive.exec.parallel.thread.number</name>
<value>8</value>
<description>How many jobs at most can be executed in parallel</description>
</property>
设置参数为:
set hive.exec.parallel = true;
应用场景1:
select col from table1
union all
select col from table2
union all
select col from table3;
应用场景2:
from(select col1,col2 from table1)t
insert overwrite table table2 partition(pt = '0')
select col1 where col2 = '0'
insert overwrite table table2 partition(pt = '1')
select col1 where col2 = '1'
insert overwrite table table2 partition(pt = '2')
select col1 where col2 = '2';