mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
S3 Select: Parsing tweaks (#8261)
* Don't output empty lines. * Trim whitespace from byte to int/float/bool conversions.
This commit is contained in:
committed by
Harshavardhana
parent
cb01516a26
commit
dac1cf5a9a
@@ -219,11 +219,12 @@ func (e *SelectStatement) AggregateRow(input Record) error {
|
||||
|
||||
// Eval - evaluates the Select statement for the given record. It
|
||||
// applies only to non-aggregation queries.
|
||||
func (e *SelectStatement) Eval(input, output Record) error {
|
||||
// The function returns whether the statement passed the WHERE clause and should be outputted.
|
||||
func (e *SelectStatement) Eval(input, output Record) (bool, error) {
|
||||
ok, err := e.isPassingWhereClause(input)
|
||||
if err != nil || !ok {
|
||||
// Either error or row did not pass where clause
|
||||
return err
|
||||
return false, err
|
||||
}
|
||||
|
||||
if e.selectAST.Expression.All {
|
||||
@@ -234,13 +235,13 @@ func (e *SelectStatement) Eval(input, output Record) error {
|
||||
if e.limitValue > -1 {
|
||||
e.outputCount++
|
||||
}
|
||||
return output.CopyFrom(input)
|
||||
return true, output.CopyFrom(input)
|
||||
}
|
||||
|
||||
for i, expr := range e.selectAST.Expression.Expressions {
|
||||
v, err := expr.evalNode(input)
|
||||
if err != nil {
|
||||
return err
|
||||
return false, err
|
||||
}
|
||||
|
||||
// Pick output column names
|
||||
@@ -258,7 +259,7 @@ func (e *SelectStatement) Eval(input, output Record) error {
|
||||
e.outputCount++
|
||||
}
|
||||
|
||||
return nil
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// LimitReached - returns true if the number of records output has
|
||||
|
||||
Reference in New Issue
Block a user