Skip to content

Commit

Permalink
[testcases](auto-partition) Add and fix testcases in P0 #33588
Browse files Browse the repository at this point in the history
  • Loading branch information
zclllyybb authored and Doris-Extras committed Apr 17, 2024
1 parent 348a043 commit 1f5116f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,6 @@
9999-12-31T23:59:59
9999-12-31T23:59:59.999999

-- !sql --
2020-12-12

Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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 "
}

0 comments on commit 1f5116f

Please sign in to comment.