2017-01-01 106 views
0

有一个分区表A,有4个分区,我想数据加载到表B.如何可以平行为MySQL分区表的每个分区

insert into B select * from A partion (p0) where type = 0; 
insert into B select * from A partion (p1) where type = 0; 
insert into B select * from A partion (p2) where type = 0; 
insert into B select * from A partion (p3) where type = 0; 

我怎样才能加载数据为每个分区执行sql在平行下。只是在一个连接。

+2

好吧,你不能。 – e4c5

+0

除了创建另一个表格(现有表格的精确副本)的全部要点是什么? – e4c5

+0

对不起,我忘记了 – elevenights

回答

0

尝试Apache Spark。

Great Documentation at this link

这些选项必须如果指定了其中任何一个都可以指定。他们描述了如何在多名员工平行读取时对表格进行分区。 partitionColumn必须是相关表中的数字列。请注意,lowerBoundupperBound只是用来决定分区跨度,而不是用于过滤表中的行。所以表中的所有行都将被分区并返回。该选项仅适用于阅读。