Skip to content

Commit

Permalink
New Query Engine is passing all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc committed Mar 7, 2016
1 parent a5cf89b commit 77cf385
Show file tree
Hide file tree
Showing 14 changed files with 1,366 additions and 53 deletions.
1 change: 1 addition & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def package_scripts(build_root):
def run_generate():
print "Running generate..."
run("go get github.com/gogo/protobuf/protoc-gen-gogo")
run("go get github.com/benbjohnson/tmpl")
run("go generate ./...")
print "Generate succeeded."
return True
Expand Down
12 changes: 6 additions & 6 deletions functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,22 @@ func (influxqlMapReducers) Percentile(field string, p float64) pipeline.MapReduc
return mr(field, "percentile", pipeline.StreamEdge, tsdb.MapEcho, r)
}

func (influxqlMapReducers) Top(limit int64, field string, fieldsOrTags ...string) pipeline.MapReduceInfo {
func (influxqlMapReducers) Top(limit int64, field string, fieldsAndTags ...string) pipeline.MapReduceInfo {
m := func(in *tsdb.MapInput) interface{} {
return tsdb.MapTopBottom(in, int(limit), fieldsOrTags, len(fieldsOrTags)+2, "top")
return tsdb.MapTopBottom(in, int(limit), fieldsAndTags, len(fieldsAndTags)+2, "top")
}
r := func(values []interface{}) interface{} {
return tsdb.ReduceTopBottom(values, int(limit), fieldsOrTags, "top")
return tsdb.ReduceTopBottom(values, int(limit), fieldsAndTags, "top")
}
return mr(field, "top", pipeline.BatchEdge, m, r)
}

func (influxqlMapReducers) Bottom(limit int64, field string, fieldsOrTags ...string) pipeline.MapReduceInfo {
func (influxqlMapReducers) Bottom(limit int64, field string, fieldsAndTags ...string) pipeline.MapReduceInfo {
m := func(in *tsdb.MapInput) interface{} {
return tsdb.MapTopBottom(in, int(limit), fieldsOrTags, len(fieldsOrTags)+2, "bottom")
return tsdb.MapTopBottom(in, int(limit), fieldsAndTags, len(fieldsAndTags)+2, "bottom")
}
r := func(values []interface{}) interface{} {
return tsdb.ReduceTopBottom(values, int(limit), fieldsOrTags, "bottom")
return tsdb.ReduceTopBottom(values, int(limit), fieldsAndTags, "bottom")
}
return mr(field, "bottom", pipeline.BatchEdge, m, r)
}
Expand Down
Loading

0 comments on commit 77cf385

Please sign in to comment.