需要将数据从一个分区表复制到另一个新分区表尝试了此方法,但不起作用
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
但两者都不起作用
1条答案
按热度按时间llew8vvj1#
用新的分区值创建表。然后,要插入到分区表中,您需要-
1.如果要在具有动态分区的表中插入,请提及分区列。
或者2.如果要使用静态分区在表中插入,请提及分区值。