Skip to content

Commit

Permalink
fix: sort unstable sqlness result (#1858)
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <[email protected]>
  • Loading branch information
waynexia committed Jun 30, 2023
1 parent c77b946 commit 25cb667
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions tests/cases/standalone/common/tql/basic.result
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ INSERT INTO test VALUES (1, 1, "a"), (1, 1, "b"), (2, 2, "a");

Affected Rows: 3

-- SQLNESS SORT_RESULT 2 1
TQL EVAL (0, 10, '5s') test;

+-----+---------------------+---+
| i | j | k |
+-----+---------------------+---+
| 2.0 | 1970-01-01T00:00:05 | a |
| 2.0 | 1970-01-01T00:00:10 | a |
| 1.0 | 1970-01-01T00:00:05 | b |
| 1.0 | 1970-01-01T00:00:10 | b |
| 2.0 | 1970-01-01T00:00:05 | a |
| 2.0 | 1970-01-01T00:00:10 | a |
+-----+---------------------+---+

TQL EVAL (0, 10, '5s') test{k="a"};
Expand Down
1 change: 1 addition & 0 deletions tests/cases/standalone/common/tql/basic.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CREATE TABLE test(i DOUBLE, j TIMESTAMP TIME INDEX, k STRING PRIMARY KEY);
-- insert two points at 1ms and one point at 2ms
INSERT INTO test VALUES (1, 1, "a"), (1, 1, "b"), (2, 2, "a");

-- SQLNESS SORT_RESULT 2 1
-- evaluate at 0s, 5s and 10s. No point at 0s.
TQL EVAL (0, 10, '5s') test;

Expand Down
2 changes: 1 addition & 1 deletion tests/runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ common-grpc = { path = "../../src/common/grpc" }
common-query = { path = "../../src/common/query" }
common-time = { path = "../../src/common/time" }
serde.workspace = true
sqlness = { git = "https://github.com/CeresDB/sqlness.git", rev = "dde4b19d7e4a41319d05a0c5bfae5c4422fde14f" }
sqlness = { git = "https://github.com/CeresDB/sqlness.git", rev = "a4663365795d2067eb53966c383e1bb0c89c7627" }
tinytemplate = "1.2"
tokio.workspace = true

0 comments on commit 25cb667

Please sign in to comment.