Skip to content

Commit

Permalink
update sqlness cases
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <[email protected]>
  • Loading branch information
waynexia committed Feb 21, 2024
1 parent 9815ebe commit 61ef729
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 56 deletions.
14 changes: 5 additions & 9 deletions tests/cases/distributed/create/partition.result
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ CREATE TABLE my_table (
b STRING,
ts TIMESTAMP TIME INDEX,
)
PARTITION BY RANGE COLUMNS (a) (
PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN (20),
PARTITION p2 VALUES LESS THAN (MAXVALUE),
PARTITION ON COLUMNS (a) (
a < 1000,
a >= 1000 AND a < 2000,
a >= 2000
);

Affected Rows: 0
Expand All @@ -17,9 +17,7 @@ SELECT table_catalog, table_schema, table_name, partition_name, partition_expres
+---------------+--------------+------------+----------------+---------------------------------+-----------------------+
| table_catalog | table_schema | table_name | partition_name | partition_expression | greptime_partition_id |
+---------------+--------------+------------+----------------+---------------------------------+-----------------------+
| greptime | public | my_table | p0 | (a) VALUES LESS THAN (10) | ID |
| greptime | public | my_table | p1 | (a) VALUES LESS THAN (20) | ID |
| greptime | public | my_table | p2 | (a) VALUES LESS THAN (MAXVALUE) | ID |
| greptime | public | my_table | p0 | (a) VALUES LESS THAN (MAXVALUE) | ID |
+---------------+--------------+------------+----------------+---------------------------------+-----------------------+

-- SQLNESS REPLACE (\d{13}) REGION_ID
Expand All @@ -30,8 +28,6 @@ SELECT region_id, peer_id, is_leader, status FROM information_schema.greptime_re
| region_id | peer_id | is_leader | status |
+---------------+---------+-----------+--------+
| REGION_ID | PEER_ID | Yes | ALIVE |
| REGION_ID | PEER_ID | Yes | ALIVE |
| REGION_ID | PEER_ID | Yes | ALIVE |
+---------------+---------+-----------+--------+

DROP TABLE my_table;
Expand Down
8 changes: 4 additions & 4 deletions tests/cases/distributed/create/partition.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ CREATE TABLE my_table (
b STRING,
ts TIMESTAMP TIME INDEX,
)
PARTITION BY RANGE COLUMNS (a) (
PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN (20),
PARTITION p2 VALUES LESS THAN (MAXVALUE),
PARTITION ON COLUMNS (a) (
a < 1000,
a >= 1000 AND a < 2000,
a >= 2000
);

-- SQLNESS REPLACE (\d{13}) ID
Expand Down
8 changes: 4 additions & 4 deletions tests/cases/distributed/explain/multi_partitions.result
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ CREATE TABLE demo(
TIME INDEX (ts),
PRIMARY KEY(host)
)
PARTITION BY RANGE COLUMNS (host) (
PARTITION r0 VALUES LESS THAN ('550-A'),
PARTITION r1 VALUES LESS THAN ('550-W'),
PARTITION r2 VALUES LESS THAN (MAXVALUE),
PARTITION ON COLUMNS (host) (
host < '550-A',
host >= '550-A' AND host < '550-W',
host >= '550-W'
);

Affected Rows: 0
Expand Down
8 changes: 4 additions & 4 deletions tests/cases/distributed/explain/multi_partitions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ CREATE TABLE demo(
TIME INDEX (ts),
PRIMARY KEY(host)
)
PARTITION BY RANGE COLUMNS (host) (
PARTITION r0 VALUES LESS THAN ('550-A'),
PARTITION r1 VALUES LESS THAN ('550-W'),
PARTITION r2 VALUES LESS THAN (MAXVALUE),
PARTITION ON COLUMNS (host) (
host < '550-A',
host >= '550-A' AND host < '550-W',
host >= '550-W'
);

-- SQLNESS REPLACE (-+) -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ Affected Rows: 0
create table AbCdEfGe(
CoLA string PRIMARY KEY,
tS timestamp time index
) PARTITION BY RANGE COLUMNS (cOlA) (
PARTITION p0 VALUES LESS THAN (MAXVALUE)
);
) PARTITION ON COLUMNS (cOlA) ();

Affected Rows: 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ drop table aBcDeFgE;
create table AbCdEfGe(
CoLA string PRIMARY KEY,
tS timestamp time index
) PARTITION BY RANGE COLUMNS (cOlA) (
PARTITION p0 VALUES LESS THAN (MAXVALUE)
);
) PARTITION ON COLUMNS (cOlA) ();

drop table abcdefge;

Expand Down
32 changes: 15 additions & 17 deletions tests/cases/standalone/common/show/show_create.result
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ CREATE TABLE system_metrics (
TIME INDEX (ts),
PRIMARY KEY (id, host)
)
PARTITION BY RANGE COLUMNS (id) (
PARTITION r0 VALUES LESS THAN (5),
PARTITION r1 VALUES LESS THAN (9),
PARTITION r2 VALUES LESS THAN (MAXVALUE),
PARTITION ON COLUMNS (id) (
id < 5,
id >= 5 AND id < 9,
id >= 9
)
ENGINE=mito
WITH(
Expand All @@ -34,14 +34,12 @@ SHOW CREATE TABLE system_metrics;
| | TIME INDEX ("ts"), |
| | PRIMARY KEY ("id", "host") |
| | ) |
| | PARTITION BY RANGE COLUMNS ("id") ( |
| | PARTITION r0 VALUES LESS THAN (5), |
| | PARTITION r1 VALUES LESS THAN (9), |
| | PARTITION r2 VALUES LESS THAN (MAXVALUE) |
| | PARTITION ON COLUMNS ("id") ( |
| | |
| | ) |
| | ENGINE=mito |
| | WITH( |
| | regions = 3, |
| | regions = 1, |
| | ttl = '7days', |
| | write_buffer_size = '1.0KiB' |
| | ) |
Expand Down Expand Up @@ -86,10 +84,10 @@ CREATE TABLE not_supported_table_options_keys (
TIME INDEX (ts),
PRIMARY KEY (id, host)
)
PARTITION BY RANGE COLUMNS (id) (
PARTITION r0 VALUES LESS THAN (5),
PARTITION r1 VALUES LESS THAN (9),
PARTITION r2 VALUES LESS THAN (MAXVALUE),
PARTITION ON COLUMNS (id) (
id < 5,
id >= 5 AND id < 9,
id >= 9
)
ENGINE=mito
WITH(
Expand All @@ -109,10 +107,10 @@ CREATE TABLE not_supported_table_storage_option (
TIME INDEX (ts),
PRIMARY KEY (id, host)
)
PARTITION BY RANGE COLUMNS (id) (
PARTITION r0 VALUES LESS THAN (5),
PARTITION r1 VALUES LESS THAN (9),
PARTITION r2 VALUES LESS THAN (MAXVALUE),
PARTITION ON COLUMNS (id) (
id < 5,
id >= 5 AND id < 9,
id >= 9
)
ENGINE=mito
WITH(
Expand Down
24 changes: 12 additions & 12 deletions tests/cases/standalone/common/show/show_create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ CREATE TABLE system_metrics (
TIME INDEX (ts),
PRIMARY KEY (id, host)
)
PARTITION BY RANGE COLUMNS (id) (
PARTITION r0 VALUES LESS THAN (5),
PARTITION r1 VALUES LESS THAN (9),
PARTITION r2 VALUES LESS THAN (MAXVALUE),
PARTITION ON COLUMNS (id) (
id < 5,
id >= 5 AND id < 9,
id >= 9
)
ENGINE=mito
WITH(
Expand Down Expand Up @@ -39,10 +39,10 @@ CREATE TABLE not_supported_table_options_keys (
TIME INDEX (ts),
PRIMARY KEY (id, host)
)
PARTITION BY RANGE COLUMNS (id) (
PARTITION r0 VALUES LESS THAN (5),
PARTITION r1 VALUES LESS THAN (9),
PARTITION r2 VALUES LESS THAN (MAXVALUE),
PARTITION ON COLUMNS (id) (
id < 5,
id >= 5 AND id < 9,
id >= 9
)
ENGINE=mito
WITH(
Expand All @@ -59,10 +59,10 @@ CREATE TABLE not_supported_table_storage_option (
TIME INDEX (ts),
PRIMARY KEY (id, host)
)
PARTITION BY RANGE COLUMNS (id) (
PARTITION r0 VALUES LESS THAN (5),
PARTITION r1 VALUES LESS THAN (9),
PARTITION r2 VALUES LESS THAN (MAXVALUE),
PARTITION ON COLUMNS (id) (
id < 5,
id >= 5 AND id < 9,
id >= 9
)
ENGINE=mito
WITH(
Expand Down

0 comments on commit 61ef729

Please sign in to comment.