Files
greptimedb/tests/cases/distributed/show/show_create.result
Ruihang Xia 8d446ed741 fix: quote ident on rendered SQL (#2248)
* fix: quote ident on rendered SQL

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* read quote style from query context

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update sqlness result

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2023-08-25 07:25:21 +00:00

76 lines
3.6 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