doris 如何修改AUTO PARTITION BY RANGE生成的自动分区

Viewed 20

现有doris表结构:

create table test3(
id bigint,
create_time datetime not null,
name varchar(150),
age int,
high double,
amount decimal(10,2),
check_times smallint,
sex char,
handle_date date,
update_time datetime,
deleted tinyint
)ENGINE=OLAP
UNIQUE KEY(`id`,`create_time`) 
AUTO PARTITION BY RANGE date_trunc(`create_time`, 'day')()
DISTRIBUTED BY HASH(`id`) BUCKETS AUTO
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"enable_unique_key_merge_on_write" = "true"
);

已生成的分区有image.png
请问能不能实现以下功能:
1、将历史分区合并到一个分区,如

ALTER TABLE test3
ADD PARTITION p20240723 VALUES LESS THAN ("2024-07-23 00:00:00");

2、将自动天分区改为自动月分区

3、如果集群资源比较小,再按照天自动分区,是不是会导致集群出问题?

1 Answers

目前还不支持这种分区合并的操作,现有的方案只能是重新建表拉数据了,如果数据量不大,只要分桶合理,按月分区没问题的。