mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-08 06:12:55 +00:00
test: add data compatibility test (#3109)
* test: data files compatibility test * rework compatibility test * revert unneeded changes * revert unneeded changes * debug CI * Update .github/workflows/develop.yml Co-authored-by: Ruihang Xia <waynestxia@gmail.com> --------- Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
13
tests/compat/case/read/standalone/read.result
Normal file
13
tests/compat/case/read/standalone/read.result
Normal file
@@ -0,0 +1,13 @@
|
||||
select ts, i, s, f from foo order by ts;
|
||||
|
||||
+---------------------+---+----------+-----+
|
||||
| ts | i | s | f |
|
||||
+---------------------+---+----------+-----+
|
||||
| 2024-02-01T17:00:00 | 1 | my_tag_1 | |
|
||||
| 2024-02-01T18:00:00 | 2 | my_tag_2 | |
|
||||
| 2024-02-01T19:00:00 | 3 | my_tag_3 | |
|
||||
| 2024-02-01T20:00:00 | 4 | my_tag_4 | 4.4 |
|
||||
| 2024-02-01T21:00:00 | 5 | my_tag_5 | 5.5 |
|
||||
| 2024-02-01T22:00:00 | 6 | my_tag_6 | 6.6 |
|
||||
+---------------------+---+----------+-----+
|
||||
|
||||
1
tests/compat/case/read/standalone/read.sql
Normal file
1
tests/compat/case/read/standalone/read.sql
Normal file
@@ -0,0 +1 @@
|
||||
select ts, i, s, f from foo order by ts;
|
||||
25
tests/compat/case/write/standalone/write.result
Normal file
25
tests/compat/case/write/standalone/write.result
Normal file
@@ -0,0 +1,25 @@
|
||||
create table foo(ts timestamp time index, s string primary key, i int);
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
insert into foo values
|
||||
("2024-02-02 01:00:00+0800", "my_tag_1", 1),
|
||||
("2024-02-02 02:00:00+0800", "my_tag_2", 2),
|
||||
("2024-02-02 03:00:00+0800", "my_tag_3", 3);
|
||||
|
||||
Affected Rows: 3
|
||||
|
||||
-- Alter the table to trigger a flush (will be executed before process being terminated).
|
||||
-- Otherwise the SST might not be generated (the data could be remained in WAL).
|
||||
-- If we have the explicitly flush table interface in the future, it's still good to have the alter table in the test.
|
||||
alter table foo add column f float;
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
insert into foo values
|
||||
("2024-02-02 04:00:00+0800", "my_tag_4", 4, 4.4),
|
||||
("2024-02-02 05:00:00+0800", "my_tag_5", 5, 5.5),
|
||||
("2024-02-02 06:00:00+0800", "my_tag_6", 6, 6.6);
|
||||
|
||||
Affected Rows: 3
|
||||
|
||||
16
tests/compat/case/write/standalone/write.sql
Normal file
16
tests/compat/case/write/standalone/write.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
create table foo(ts timestamp time index, s string primary key, i int);
|
||||
|
||||
insert into foo values
|
||||
("2024-02-02 01:00:00+0800", "my_tag_1", 1),
|
||||
("2024-02-02 02:00:00+0800", "my_tag_2", 2),
|
||||
("2024-02-02 03:00:00+0800", "my_tag_3", 3);
|
||||
|
||||
-- Alter the table to trigger a flush (will be executed before process being terminated).
|
||||
-- Otherwise the SST might not be generated (the data could be remained in WAL).
|
||||
-- If we have the explicitly flush table interface in the future, it's still good to have the alter table in the test.
|
||||
alter table foo add column f float;
|
||||
|
||||
insert into foo values
|
||||
("2024-02-02 04:00:00+0800", "my_tag_4", 4, 4.4),
|
||||
("2024-02-02 05:00:00+0800", "my_tag_5", 5, 5.5),
|
||||
("2024-02-02 06:00:00+0800", "my_tag_6", 6, 6.6);
|
||||
Reference in New Issue
Block a user