aggregation functions' argument may already has been cast to numeric (#7876)

master
Yao Zongyou 6 years ago committed by Harshavardhana
parent 037319066f
commit 60831e3299
  1. 14
      pkg/s3select/sql/aggregation.go

@ -103,12 +103,14 @@ func (e *FuncExpr) evalAggregationNode(r Record) error {
// Here, we diverge from Amazon S3 behavior by
// inferring untyped values are numbers.
if i, ok := argVal.bytesToInt(); ok {
argVal.setInt(i)
} else if f, ok := argVal.bytesToFloat(); ok {
argVal.setFloat(f)
} else {
return errNonNumericArg(funcName)
if !argVal.isNumeric() {
if i, ok := argVal.bytesToInt(); ok {
argVal.setInt(i)
} else if f, ok := argVal.bytesToFloat(); ok {
argVal.setFloat(f)
} else {
return errNonNumericArg(funcName)
}
}
}

Loading…
Cancel
Save