diff --git a/influxql/ast.go b/influxql/ast.go index aefdd4e049..2bc53b2fac 100644 --- a/influxql/ast.go +++ b/influxql/ast.go @@ -928,17 +928,17 @@ func walkNames(exp Expr) []string { return nil } -// AggregateCalls returns the Call objects from the query -func (s *SelectStatement) AggregateCalls() []*Call { +// FunctionCalls returns the Call objects from the query +func (s *SelectStatement) FunctionCalls() []*Call { var a []*Call for _, f := range s.Fields { - a = append(a, s.walkAggregateCalls(f.Expr)...) + a = append(a, walkFunctionCalls(f.Expr)...) } return a } -// walkAggregateCalls walks the Field of a query for any aggregate calls made -func (s *SelectStatement) walkAggregateCalls(exp Expr) []*Call { +// walkFunctionCalls walks the Field of a query for any function calls made +func walkFunctionCalls(exp Expr) []*Call { switch expr := exp.(type) { case *VarRef: return nil @@ -946,11 +946,11 @@ func (s *SelectStatement) walkAggregateCalls(exp Expr) []*Call { return []*Call{expr} case *BinaryExpr: var ret []*Call - ret = append(ret, s.walkAggregateCalls(expr.LHS)...) - ret = append(ret, s.walkAggregateCalls(expr.RHS)...) + ret = append(ret, walkFunctionCalls(expr.LHS)...) + ret = append(ret, walkFunctionCalls(expr.RHS)...) return ret case *ParenExpr: - return s.walkAggregateCalls(expr.Expr) + return walkFunctionCalls(expr.Expr) } return nil diff --git a/influxql/engine.go b/influxql/engine.go index 09d5e0ee9e..591612a6b4 100644 --- a/influxql/engine.go +++ b/influxql/engine.go @@ -68,7 +68,7 @@ func (m *MapReduceJob) Key() []byte { } func (m *MapReduceJob) Execute(out chan *Row, filterEmptyResults bool) { - aggregates := m.stmt.AggregateCalls() + aggregates := m.stmt.FunctionCalls() reduceFuncs := make([]ReduceFunc, len(aggregates)) for i, c := range aggregates { reduceFunc, err := InitializeReduceFunc(c)