mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-13 00:32:56 +00:00
* temp commit * feat: impl Display for CreateTable statement * feat: impl show create table for standalone * fix: forgot show.rs * feat: clean code * fix: typo * feat: impl show create table for distributed * test: add show create table sqlness test * fix: typo * fix: sqlness tests * feat: render partition rules for distributed table * Update src/sql/src/statements.rs Co-authored-by: Yingwen <realevenyag@gmail.com> * Update src/sql/src/statements.rs Co-authored-by: Yingwen <realevenyag@gmail.com> * Update src/sql/src/statements.rs Co-authored-by: Yingwen <realevenyag@gmail.com> * Update src/sql/src/statements/create.rs Co-authored-by: Yingwen <realevenyag@gmail.com> * chore: by CR comments * fix: compile error * fix: missing column comments and extra table options * test: add show create table test * test: add show create table test * chore: timestamp precision * fix: test --------- Co-authored-by: Yingwen <realevenyag@gmail.com>
19 lines
350 B
SQL
19 lines
350 B
SQL
CREATE TABLE system_metrics (
|
|
id INT UNSIGNED NULL,
|
|
host STRING NULL,
|
|
cpu DOUBLE NULL COMMENT 'cpu',
|
|
disk FLOAT NULL,
|
|
ts TIMESTAMP NOT NULL DEFAULT current_timestamp(),
|
|
TIME INDEX (ts),
|
|
PRIMARY KEY (id, host)
|
|
)
|
|
ENGINE=mito
|
|
WITH(
|
|
ttl = '7d',
|
|
write_buffer_size = 1024
|
|
);
|
|
|
|
SHOW CREATE TABLE system_metrics;
|
|
|
|
DROP TABLE system_metrics;
|