mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmselect/promql/eval.go:evalAggrFunc shunts evaluation of AggrFuncExpr over rollupFunc over MetricsExpr to an optimized path. tryGetArgRollupFuncWithMetricExpr() checks whether expression can be shunted, but it mangles the AggrFuncExpr when the aggregation function has more than one argument. This results in queries like `sum(aggr_over_time("avg_over_time",m))` failing with error message 'expecting at least 2 args to "aggr_over_time"; got 1 args' while the analogous query `sum(avg_over_time(m))` executes successfully. This fix removes the unnecessary mangling. Signed-off-by: Anton Tykhyy <atykhyy@gmail.com>
This commit is contained in:
parent
4ee42e9e73
commit
51af1dfff7
1 changed files with 1 additions and 4 deletions
|
@ -701,10 +701,7 @@ func tryGetArgRollupFuncWithMetricExpr(ae *metricsql.AggrFuncExpr) (*metricsql.F
|
|||
return nil, nil
|
||||
}
|
||||
// e = rollupFunc(metricExpr)
|
||||
return &metricsql.FuncExpr{
|
||||
Name: fe.Name,
|
||||
Args: []metricsql.Expr{me},
|
||||
}, nrf
|
||||
return fe, nrf
|
||||
}
|
||||
if re, ok := arg.(*metricsql.RollupExpr); ok {
|
||||
if me, ok := re.Expr.(*metricsql.MetricExpr); !ok || me.IsEmpty() || re.ForSubquery() {
|
||||
|
|
Loading…
Reference in a new issue