mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-28 00:42:56 +00:00
* feat: impl admin statement parser * feat: introduce AsyncFunction and implements it for admin functions * feat: execute admin functions * fix: license header * fix: panic in test * chore: fixed by code review
53 lines
1.4 KiB
Plaintext
53 lines
1.4 KiB
Plaintext
--- test flush_region and compact_region ---
|
|
CREATE TABLE my_table (
|
|
a INT PRIMARY KEY,
|
|
b STRING,
|
|
ts TIMESTAMP TIME INDEX,
|
|
)
|
|
PARTITION ON COLUMNS (a) ();
|
|
|
|
Affected Rows: 0
|
|
|
|
INSERT INTO my_table VALUES
|
|
(1, 'a', 1),
|
|
(2, 'b', 2),
|
|
(11, 'c', 3),
|
|
(12, 'd', 4),
|
|
(21, 'e', 5),
|
|
(22, 'f', 5);
|
|
|
|
Affected Rows: 6
|
|
|
|
SELECT * FROM my_table;
|
|
|
|
+----+---+-------------------------+
|
|
| a | b | ts |
|
|
+----+---+-------------------------+
|
|
| 1 | a | 1970-01-01T00:00:00.001 |
|
|
| 2 | b | 1970-01-01T00:00:00.002 |
|
|
| 11 | c | 1970-01-01T00:00:00.003 |
|
|
| 12 | d | 1970-01-01T00:00:00.004 |
|
|
| 21 | e | 1970-01-01T00:00:00.005 |
|
|
| 22 | f | 1970-01-01T00:00:00.005 |
|
|
+----+---+-------------------------+
|
|
|
|
-- SELECT flush_region(greptime_partition_id) from information_schema.partitions WHERE table_name = 'my_table'; --
|
|
-- SELECT compact_region(greptime_partition_id) from information_schema.partitions WHERE table_name = 'my_table'; --
|
|
SELECT * FROM my_table;
|
|
|
|
+----+---+-------------------------+
|
|
| a | b | ts |
|
|
+----+---+-------------------------+
|
|
| 1 | a | 1970-01-01T00:00:00.001 |
|
|
| 2 | b | 1970-01-01T00:00:00.002 |
|
|
| 11 | c | 1970-01-01T00:00:00.003 |
|
|
| 12 | d | 1970-01-01T00:00:00.004 |
|
|
| 21 | e | 1970-01-01T00:00:00.005 |
|
|
| 22 | f | 1970-01-01T00:00:00.005 |
|
|
+----+---+-------------------------+
|
|
|
|
DROP TABLE my_table;
|
|
|
|
Affected Rows: 0
|
|
|