mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-04 12:22:55 +00:00
fix: do not change timestamp index column while planning aggr (#1688)
* fix: do not change timestamp index column while planning aggr Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * remove println Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -141,9 +141,6 @@ impl PromPlanner {
|
||||
// convert op and value columns to aggregate exprs
|
||||
let aggr_exprs = self.create_aggregate_exprs(*op, &input)?;
|
||||
|
||||
// remove time index column from context
|
||||
self.ctx.time_index_column = None;
|
||||
|
||||
// create plan
|
||||
let group_sort_expr = group_exprs
|
||||
.clone()
|
||||
|
||||
@@ -414,12 +414,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 | SUM(http_requests.value) + MIN(http_requests.value) + MAX(http_requests.value) + AVG(http_requests.value) |\
|
||||
\n+------------+-----------------------------------------------------------------------------------------------------------+\
|
||||
\n| api-server | 1750.0 |\
|
||||
\n| app-server | 4550.0 |\
|
||||
\n+------------+-----------------------------------------------------------------------------------------------------------+",
|
||||
"+------------+---------------------+-----------------------------------------------------------------------------------------------------------+\
|
||||
\n| job | ts | SUM(http_requests.value) + MIN(http_requests.value) + MAX(http_requests.value) + 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;
|
||||
}
|
||||
@@ -439,12 +439,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 | SUM(http_requests.value) + MIN(http_requests.value) |\
|
||||
\n+------------+-----------------------------------------------------+\
|
||||
\n| api-server | 1100.0 |\
|
||||
\n| app-server | 3100.0 |\
|
||||
\n+------------+-----------------------------------------------------+",
|
||||
"+------------+---------------------+-----------------------------------------------------+\
|
||||
\n| job | ts | SUM(http_requests.value) + 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user