![](/img/trans.png)
[英]How to minimize the RAM requirements for copying data from (large) partitioned table to another partitioned table?
[英]copy data from one partitioned table to another new partitioned table
需要将数据从一个分区表复制到另一个新的分区表尝试了这种方法但不起作用
create table if not exists box_db.table_1 partitioned by (sch_ky, at_ky, date) as select * from sand_db.table_2
也试过
create table box_db.table_1 (id bigint, sch_val int, at_val int) partitioned by (sch_ky int, at_ky int, date string)
并将数据插入其中
insert into box_db.table_1 select * from sand_db.table_2
但两者都不起作用
使用新的分区值创建表。 然后插入分区表,你需要 -
insert into box_db.table_1 partition(id, sch_val, at_val) select ..., id,sch_val, at_val from sand_db.table_2 -- make sure last columns matches to last columns in select clause
或 2. 如果您要使用 static 分区插入表中,请提及分区值。
insert into box_db.table_1 partition(id=1, sch_val=2, at_val=3) select ... from sand_db.table_2 -- make sure all columns in select matches to the columns in table
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.