Add integration test for partition.

Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
This commit is contained in:
Jianfei Hu 2023-06-20 05:17:07 +00:00
parent 5e3a69b4c4
commit 7769dad0c4

View File

@ -56,6 +56,20 @@ def test_config_with_standard_part_log(start_cluster):
assert node2.query("SELECT * FROM system.part_log") != ""
def test_part_log_contains_partition(start_cluster):
node2.query(
"CREATE TABLE test_partition_table (date Date, word String, value UInt64) ENGINE=MergeTree() " +
"PARTITION BY toYYYYMM(date) Order by value"
)
node2.query("INSERT INTO test_partition_table VALUES " +
"('2023-06-20', 'a', 10), ('2023-06-21', 'b', 11)," +
"('2023-05-20', 'cc', 14),('2023-05-21', 'd1', 15);"
)
node2.query("SYSTEM FLUSH LOGS")
resp = node2.query("SELECT partition from system.part_log where table = 'test_partition_table'")
assert(resp == "202306\n202305\n")
def test_config_with_non_standard_part_log(start_cluster):
node3.query(
"CREATE TABLE test_table(word String, value UInt64) ENGINE=MergeTree() Order by value"