mirror of
https://github.com/minio/minio.git
synced 2025-04-20 18:44:21 -04:00
aggregation functions' argument may already has been cast to numeric (#7876)
This commit is contained in:
parent
037319066f
commit
60831e3299
@ -103,12 +103,14 @@ func (e *FuncExpr) evalAggregationNode(r Record) error {
|
|||||||
|
|
||||||
// Here, we diverge from Amazon S3 behavior by
|
// Here, we diverge from Amazon S3 behavior by
|
||||||
// inferring untyped values are numbers.
|
// inferring untyped values are numbers.
|
||||||
if i, ok := argVal.bytesToInt(); ok {
|
if !argVal.isNumeric() {
|
||||||
argVal.setInt(i)
|
if i, ok := argVal.bytesToInt(); ok {
|
||||||
} else if f, ok := argVal.bytesToFloat(); ok {
|
argVal.setInt(i)
|
||||||
argVal.setFloat(f)
|
} else if f, ok := argVal.bytesToFloat(); ok {
|
||||||
} else {
|
argVal.setFloat(f)
|
||||||
return errNonNumericArg(funcName)
|
} else {
|
||||||
|
return errNonNumericArg(funcName)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user