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

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

@ -103,6 +103,7 @@ func (e *FuncExpr) evalAggregationNode(r Record) error {
// Here, we diverge from Amazon S3 behavior by
// inferring untyped values are numbers.
if !argVal.isNumeric() {
if i, ok := argVal.bytesToInt(); ok {
argVal.setInt(i)
} else if f, ok := argVal.bytesToFloat(); ok {
@ -111,6 +112,7 @@ func (e *FuncExpr) evalAggregationNode(r Record) error {
return errNonNumericArg(funcName)
}
}
}
// Mark that we have seen one non-null value.
isFirstRow := false

Loading…
Cancel
Save