fix: sort unstable sqlness result (#1858)

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Ruihang Xia
2023-06-30 17:25:24 +08:00
committed by GitHub
parent c77b94650c
commit 25cb667470
4 changed files with 6 additions and 4 deletions

2
Cargo.lock generated
View File

@@ -8935,7 +8935,7 @@ dependencies = [
[[package]]
name = "sqlness"
version = "0.4.3"
source = "git+https://github.com/CeresDB/sqlness.git?rev=dde4b19d7e4a41319d05a0c5bfae5c4422fde14f#dde4b19d7e4a41319d05a0c5bfae5c4422fde14f"
source = "git+https://github.com/CeresDB/sqlness.git?rev=a4663365795d2067eb53966c383e1bb0c89c7627#a4663365795d2067eb53966c383e1bb0c89c7627"
dependencies = [
"async-trait",
"derive_builder 0.11.2",

View File

@@ -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"};

View File

@@ -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;

View File

@@ -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