apache / apache/doris

Truncate table Partition does not exist

Open
#62,210 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
15.9k
Forks
3.9k
Avg merge
2d 23h
Merged PRs (30d)
520

Description

A partition that does not exist, causing truncate to fail,should require an additional check
1、create table
CREATE TABLE `range_table_nullable` (
`k1` int NULL,
`k2` date NOT NULL,
`k3` datetime(6) NULL
) ENGINE=OLAP
DUPLICATE KEY(`k1`)
AUTO PARTITION BY RANGE (date_trunc(`k2`, 'day'))
(PARTITION p20260402000000 VALUES [('2026-04-02'), ('2026-04-03')),
PARTITION p20260403000000 VALUES [('2026-04-03'), ('2026-04-04')))
DISTRIBUTED BY HASH(`k1`) BUCKETS 16
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"min_load_replica_num" = "-1",
"is_being_synced" = "false",
"storage_medium" = "hdd",
"storage_format" = "V2",
"inverted_index_storage_format" = "V1",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false",
"group_commit_interval_ms" = "10000",
"group_commit_data_bytes" = "134217728"
);

2、insert into range_table_nullable (k1,k2,k3) values (2,'2026-04-03','2026-04-03')

3、truncate table range_table_nullable PARTITION(p20260406000000,p20260403000000);
ERROR 1105 (HY000): errCode = 2, detailMessage = Partition p20260406000000 does not exist

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.