This is an automated email from the ASF dual-hosted git repository. kxiao pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 451b05a77d276abc90f01ab7c05613a5dcfc3789 Author: Pxl <pxl...@qq.com> AuthorDate: Fri Sep 8 10:11:30 2023 +0800 [Bug](partition) fix cannot delete from partitions (#24053) --- fe/fe-core/src/main/cup/sql_parser.cup | 2 -- .../suites/delete_p0/test_delete.groovy | 30 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/cup/sql_parser.cup b/fe/fe-core/src/main/cup/sql_parser.cup index dd8dceee64..99758c1dbd 100644 --- a/fe/fe-core/src/main/cup/sql_parser.cup +++ b/fe/fe-core/src/main/cup/sql_parser.cup @@ -7485,8 +7485,6 @@ keyword ::= {: RESULT = id; :} | KW_PARAMETER:id {: RESULT = id; :} - | KW_PARTITIONS:id - {: RESULT = id; :} | KW_PASSWORD:id {: RESULT = id; :} | KW_PASSWORD_EXPIRE:id diff --git a/regression-test/suites/delete_p0/test_delete.groovy b/regression-test/suites/delete_p0/test_delete.groovy index bcd648c2fd..aff35b978c 100644 --- a/regression-test/suites/delete_p0/test_delete.groovy +++ b/regression-test/suites/delete_p0/test_delete.groovy @@ -250,4 +250,34 @@ suite("test_delete") { sql 'select * from test1 order by x' result([['a', 'a']]) } + + sql "drop table if exists dwd_pay" + sql """ + CREATE TABLE `dwd_pay` ( + `tenant_id` int(11) DEFAULT NULL COMMENT '租户ID', + `pay_time` datetime DEFAULT NULL COMMENT '付款时间', +) ENGINE=OLAP +DUPLICATE KEY(`tenant_id`) +COMMENT "付款明细" +PARTITION BY RANGE(`pay_time` ) ( +PARTITION p202012 VALUES LESS THAN ('2021-01-01 00:00:00') +) +DISTRIBUTED BY HASH(`tenant_id`) BUCKETS auto +PROPERTIES +( + "dynamic_partition.enable" = "true", + "dynamic_partition.time_unit" = "MONTH", + "dynamic_partition.end" = "2", + "dynamic_partition.prefix" = "p", + "dynamic_partition.start_day_of_month" = "1", + "dynamic_partition.create_history_partition" = "true", + "dynamic_partition.history_partition_num" = "120", + "dynamic_partition.buckets"="1", + "estimate_partition_size" = "1G", + "storage_type" = "COLUMN", + "replication_num" = "1" +); + """ + + sql "delete from dwd_pay partitions(p202310) where pay_time = '20231002';" } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org