fix: qualify inputs on handling join in promql (#2297)

* add qualifier to join inputs

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* add one more case

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update test results

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Ruihang Xia
2023-08-31 22:51:34 -05:00
committed by GitHub
parent a0d15b489a
commit a12ee5cab8
4 changed files with 207 additions and 40 deletions

View File

@@ -0,0 +1,43 @@
create table completion(
ts timestamp time index,
model string primary key,
val double
);
insert into completion values
(0, 'model-a', 10),
(5000, 'model-b', 20),
(10000, 'model-a', 30);
create table prompt(
ts timestamp time index,
model string primary key,
val double
);
insert into prompt values
(0, 'model-a', 100),
(5000, 'model-b', 200),
(10000, 'model-a', 300);
-- SQLNESS SORT_RESULT 3 1
tql eval(0, 10, '5s') sum(completion * 0.0015 / 1000) + sum(prompt / 1000 * 0.0015);
-- SQLNESS SORT_RESULT 3 1
tql eval(0, 10, '5s') sum(completion * 0.0015 / 1000) + sum(prompt * 0.0015 / 1000);
-- SQLNESS SORT_RESULT 3 1
tql eval(0, 10, '5s') sum(completion * 0.0015 / 1000) by (model) + sum(prompt * 0.0015 / 1000) by (model);
-- SQLNESS SORT_RESULT 3 1
tql eval(0, 10, '5s') sum(completion * 0.0015 / 1000) by (model) + sum(prompt * 0.0015 / 1000);
-- SQLNESS SORT_RESULT 3 1
tql eval(0, 10, '5s') sum(completion / 1000) + max(completion / 1000);
-- SQLNESS SORT_RESULT 3 1
tql eval(0, 10, '5s') sum(completion / 1000) + sum(completion / 1000);
drop table completion;
drop table prompt;