Files
greptimedb/tests/cases/distributed/show/show_create.result
Niwaka b3b43fe1c3 fix: table options can't be found in distributed mode (#2209)
* fix: table options can't be found in distributed mode

* refactor: use iterator for regions_numbers

* chore: remove TODO
2023-08-22 03:53:56 +00:00

76 lines
3.5 KiB
Plaintext

CREATE TABLE system_metrics (
id INT UNSIGNED,
host STRING,
cpu DOUBLE,
disk FLOAT,
n INT COMMENT 'range key',
ts TIMESTAMP NOT NULL DEFAULT current_timestamp(),
TIME INDEX (ts),
PRIMARY KEY (id, host)
)
PARTITION BY RANGE COLUMNS (n) (
PARTITION r0 VALUES LESS THAN (5),
PARTITION r1 VALUES LESS THAN (9),
PARTITION r2 VALUES LESS THAN (MAXVALUE),
)
ENGINE=mito;
Affected Rows: 0
SHOW CREATE TABLE system_metrics;
+----------------+----------------------------------------------------------+
| Table | Create Table |
+----------------+----------------------------------------------------------+
| system_metrics | CREATE TABLE IF NOT EXISTS system_metrics ( |
| | id INT UNSIGNED NULL, |
| | host STRING NULL, |
| | cpu DOUBLE NULL, |
| | disk FLOAT NULL, |
| | n INT NULL, |
| | ts TIMESTAMP(3) NOT NULL DEFAULT current_timestamp(), |
| | TIME INDEX (ts), |
| | PRIMARY KEY (id, host) |
| | ) |
| | PARTITION BY RANGE COLUMNS (n) ( |
| | PARTITION r0 VALUES LESS THAN (5), |
| | PARTITION r1 VALUES LESS THAN (9), |
| | PARTITION r2 VALUES LESS THAN (MAXVALUE) |
| | ) |
| | ENGINE=mito |
| | WITH( |
| | regions = 3 |
| | ) |
+----------------+----------------------------------------------------------+
DROP TABLE system_metrics;
Affected Rows: 1
create table table_without_partition (
ts TIMESTAMP TIME INDEX NOT NULL DEFAULT current_timestamp()
);
Affected Rows: 0
show create table table_without_partition;
+-------------------------+---------------------------------------------------------+
| Table | Create Table |
+-------------------------+---------------------------------------------------------+
| table_without_partition | CREATE TABLE IF NOT EXISTS table_without_partition ( |
| | ts TIMESTAMP(3) NOT NULL DEFAULT current_timestamp(), |
| | TIME INDEX (ts) |
| | ) |
| | |
| | ENGINE=mito |
| | WITH( |
| | regions = 1 |
| | ) |
+-------------------------+---------------------------------------------------------+
drop table table_without_partition;
Affected Rows: 1