mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-06 05:12:54 +00:00
feat: support PromQL operations over the same metric (#3124)
* update sqlness result Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update ut cases Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * remove deadcode Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -441,12 +441,12 @@ async fn aggregators_complex_combined_aggrs(instance: Arc<dyn MockInstance>) {
|
||||
unix_epoch_plus_100s(),
|
||||
Duration::from_secs(60),
|
||||
Duration::from_secs(0),
|
||||
"+------------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\
|
||||
\n| job | ts | http_requests.http_requests.http_requests.SUM(http_requests.value) + http_requests.MIN(http_requests.value) + http_requests.MAX(http_requests.value) + http_requests.AVG(http_requests.value) |\
|
||||
\n+------------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\
|
||||
\n| api-server | 1970-01-01T00:00:00 | 1750.0 |\
|
||||
\n| app-server | 1970-01-01T00:00:00 | 4550.0 |\
|
||||
\n+------------+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
||||
"+------------+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------+\
|
||||
\n| job | ts | lhs.lhs.lhs.SUM(http_requests.value) + rhs.MIN(http_requests.value) + http_requests.MAX(http_requests.value) + rhs.AVG(http_requests.value) |\
|
||||
\n+------------+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------+\
|
||||
\n| api-server | 1970-01-01T00:00:00 | 1750.0 |\
|
||||
\n| app-server | 1970-01-01T00:00:00 | 4550.0 |\
|
||||
\n+------------+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------+",
|
||||
)
|
||||
.await;
|
||||
}
|
||||
@@ -466,12 +466,12 @@ async fn two_aggregators_combined_aggrs(instance: Arc<dyn MockInstance>) {
|
||||
unix_epoch_plus_100s(),
|
||||
Duration::from_secs(60),
|
||||
Duration::from_secs(0),
|
||||
"+------------+---------------------+---------------------------------------------------------------------------------+\
|
||||
\n| job | ts | http_requests.SUM(http_requests.value) + http_requests.MIN(http_requests.value) |\
|
||||
\n+------------+---------------------+---------------------------------------------------------------------------------+\
|
||||
\n| api-server | 1970-01-01T00:00:00 | 1100.0 |\
|
||||
\n| app-server | 1970-01-01T00:00:00 | 3100.0 |\
|
||||
\n+------------+---------------------+---------------------------------------------------------------------------------+",
|
||||
"+------------+---------------------+-------------------------------------------------------------+\
|
||||
\n| job | ts | lhs.SUM(http_requests.value) + rhs.MIN(http_requests.value) |\
|
||||
\n+------------+---------------------+-------------------------------------------------------------+\
|
||||
\n| api-server | 1970-01-01T00:00:00 | 1100.0 |\
|
||||
\n| app-server | 1970-01-01T00:00:00 | 3100.0 |\
|
||||
\n+------------+---------------------+-------------------------------------------------------------+",
|
||||
)
|
||||
.await;
|
||||
}
|
||||
@@ -519,18 +519,18 @@ async fn binary_op_plain_columns(instance: Arc<dyn MockInstance>) {
|
||||
unix_epoch_plus_100s(),
|
||||
Duration::from_secs(60),
|
||||
Duration::from_secs(0),
|
||||
"+------------+----------+------------+---------------------+-------------------------------------------+\
|
||||
\n| job | instance | group | ts | http_requests.value - http_requests.value |\
|
||||
\n+------------+----------+------------+---------------------+-------------------------------------------+\
|
||||
\n| api-server | 0 | canary | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| api-server | 0 | production | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| api-server | 1 | canary | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| api-server | 1 | production | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| app-server | 0 | canary | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| app-server | 0 | production | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| app-server | 1 | canary | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| app-server | 1 | production | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n+------------+----------+------------+---------------------+-------------------------------------------+",
|
||||
"+------------+----------+------------+---------------------+-----------------------+\
|
||||
\n| job | instance | group | ts | lhs.value - rhs.value |\
|
||||
\n+------------+----------+------------+---------------------+-----------------------+\
|
||||
\n| api-server | 0 | canary | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| api-server | 0 | production | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| api-server | 1 | canary | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| api-server | 1 | production | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| app-server | 0 | canary | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| app-server | 0 | production | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| app-server | 1 | canary | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n| app-server | 1 | production | 1970-01-01T00:00:00 | 0.0 |\
|
||||
\n+------------+----------+------------+---------------------+-----------------------+",
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user