mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-20 02:42:29 +00:00
* test: add recent sqlness compat cases Signed-off-by: discord9 <discord9@163.com> * test: add more sqlness compat cases Signed-off-by: discord9 <discord9@163.com> --------- Signed-off-by: discord9 <discord9@163.com>
42 lines
1.8 KiB
Plaintext
42 lines
1.8 KiB
Plaintext
SELECT host, ts, cpu, memory
|
|
FROM t_last_row_merge
|
|
ORDER BY host, ts;
|
|
|
|
+-------+-------------------------+------+--------+
|
|
| host | ts | cpu | memory |
|
|
+-------+-------------------------+------+--------+
|
|
| host1 | 1970-01-01T00:00:00 | | 10.0 |
|
|
| host2 | 1970-01-01T00:00:00.001 | 11.0 | |
|
|
+-------+-------------------------+------+--------+
|
|
|
|
SELECT host, cpu, memory
|
|
FROM t_last_row_merge
|
|
WHERE memory IS NULL
|
|
ORDER BY host;
|
|
|
|
+-------+------+--------+
|
|
| host | cpu | memory |
|
|
+-------+------+--------+
|
|
| host2 | 11.0 | |
|
|
+-------+------+--------+
|
|
|
|
SHOW CREATE TABLE t_last_row_merge;
|
|
|
|
+------------------+-------------------------------------------------+
|
|
| Table | Create Table |
|
|
+------------------+-------------------------------------------------+
|
|
| t_last_row_merge | CREATE TABLE IF NOT EXISTS "t_last_row_merge" ( |
|
|
| | "host" STRING NULL, |
|
|
| | "ts" TIMESTAMP(3) NOT NULL, |
|
|
| | "cpu" DOUBLE NULL, |
|
|
| | "memory" DOUBLE NULL, |
|
|
| | TIME INDEX ("ts"), |
|
|
| | PRIMARY KEY ("host") |
|
|
| | ) |
|
|
| | |
|
|
| | ENGINE=mito |
|
|
| | WITH( |
|
|
| | merge_mode = 'last_row' |
|
|
| | ) |
|
|
+------------------+-------------------------------------------------+
|