Skip to content

Commit

Permalink
chore: add integration tests for random partition table
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiKaiWi committed Sep 5, 2023
1 parent b8a2dca commit 080b7f4
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions integration_tests/cases/env/cluster/ddl/partition_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,52 @@ SELECT * from partition_table_t where name in ("ceresdb5", "ceresdb6", "ceresdb7
DROP TABLE IF EXISTS `partition_table_t`;

SHOW CREATE TABLE partition_table_t;

DROP TABLE IF EXISTS `random_partition_table_t`;

DROP TABLE IF EXISTS `__random_partition_table_t_0`;

CREATE TABLE `random_partition_table_t`(
`name`string TAG,
`id` int TAG,
`value` double NOT NULL,
`t` timestamp NOT NULL,
TIMESTAMP KEY(t)
) PARTITIONS 4 ENGINE = Analytic with (enable_ttl='false', mode="append");

SHOW CREATE TABLE random_partition_table_t;

SHOW CREATE TABLE __random_partition_table_t_0;

INSERT INTO random_partition_table_t (t, name, value)
VALUES (1651737067000, "ceresdb0", 100),
(1651737067000, "ceresdb1", 101),
(1651737067000, "ceresdb2", 102),
(1651737067000, "ceresdb3", 103),
(1651737067000, "ceresdb4", 104),
(1651737067000, "ceresdb5", 105),
(1651737067000, "ceresdb6", 106),
(1651737067000, "ceresdb7", 107),
(1651737067000, "ceresdb8", 108),
(1651737067000, "ceresdb9", 109),
(1651737067000, "ceresdb10", 110);

SELECT * from __random_partition_table_t_0 where name = "ceresdb0";

SELECT * from random_partition_table_t where name = "ceresdb0";

SELECT * from random_partition_table_t where name = "ceresdb5";

DROP TABLE IF EXISTS `random_partition_table_t`;

SHOW CREATE TABLE random_partition_table_t;

DROP TABLE IF EXISTS `random_partition_table_t_overwrite`;

CREATE TABLE `random_partition_table_t_overwrite`(
`name`string TAG,
`id` int TAG,
`value` double NOT NULL,
`t` timestamp NOT NULL,
TIMESTAMP KEY(t)
) PARTITIONS 4 ENGINE = Analytic with (enable_ttl='false', mode="overwrite");

0 comments on commit 080b7f4

Please sign in to comment.