This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 6c2e684a4f7ccac3841bae265a9aeaabd80ff234 Author: zclllyybb <zhaochan...@selectdb.com> AuthorDate: Fri Apr 12 23:18:33 2024 +0800 [testcases](auto-partition) Add and fix testcases in P0 #33588 --- .../auto_partition/test_auto_range_partition.out | 3 +++ .../test_auto_range_partition.groovy | 29 +++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/regression-test/data/partition_p0/auto_partition/test_auto_range_partition.out b/regression-test/data/partition_p0/auto_partition/test_auto_range_partition.out index 93c6d86bf9c..dadc18076a4 100644 --- a/regression-test/data/partition_p0/auto_partition/test_auto_range_partition.out +++ b/regression-test/data/partition_p0/auto_partition/test_auto_range_partition.out @@ -108,3 +108,6 @@ 9999-12-31T23:59:59 9999-12-31T23:59:59.999999 +-- !sql -- +2020-12-12 + diff --git a/regression-test/suites/partition_p0/auto_partition/test_auto_range_partition.groovy b/regression-test/suites/partition_p0/auto_partition/test_auto_range_partition.groovy index e0f8db3ac8f..e17f4f8ef8a 100644 --- a/regression-test/suites/partition_p0/auto_partition/test_auto_range_partition.groovy +++ b/regression-test/suites/partition_p0/auto_partition/test_auto_range_partition.groovy @@ -117,7 +117,7 @@ suite("test_auto_range_partition") { ); """ sql " insert into week_range values (20240408), (20240409); " - result2 = sql "show partitions from week_range" + def result2 = sql "show partitions from week_range" logger.info("${result2}") assertEquals(result2.size(), 1) @@ -139,4 +139,31 @@ suite("test_auto_range_partition") { result2 = sql "show partitions from quarter_range" logger.info("${result2}") assertEquals(result2.size(), 2) + + // partition expr extraction + + sql " drop table if exists isit " + sql " drop table if exists isit_src " + sql """ + CREATE TABLE isit ( + k DATE NOT NULL + ) + AUTO PARTITION BY RANGE (date_trunc(k, 'day'))() + DISTRIBUTED BY HASH(k) BUCKETS AUTO + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1" + ); + """ + sql """ + CREATE TABLE isit_src ( + k DATE NOT NULL + ) + DISTRIBUTED BY HASH(k) BUCKETS AUTO + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1" + ); + """ + sql " insert into isit_src values (20201212); " + sql " insert into isit select * from isit_src " + qt_sql " select * from isit order by k " } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org