app/vmselect/promql: check for binary operation in case-insensitive manner when deciding which side of the operation to perform the first

PromQL and MetricsQL operators are case-insensitive
This commit is contained in:
Aliaksandr Valialkin 2022-01-31 22:06:05 +02:00
parent f50cf60534
commit a8d22e1223
No known key found for this signature in database
GPG Key ID: A72BEC6CD3D0DED1

View File

@ -283,7 +283,7 @@ func evalExpr(ec *EvalConfig, e metricsql.Expr) ([]*timeseries, error) {
}
var err error
var tssLeft, tssRight []*timeseries
switch be.Op {
switch strings.ToLower(be.Op) {
case "and", "if":
// Fetch right-side series at first, since the left side of `and` and `if` operator
// usually contains lower number of time series. This should produce more specific label filters