address review of "Apply base in GroupBy on BSI"

This commit is contained in:
Jaden Weiss 2020-06-10 17:49:00 -04:00
parent 535257af75
commit 32e47642ae
No known key found for this signature in database
GPG key ID: 177F065773634B67
2 changed files with 4 additions and 3 deletions

View file

@ -1799,10 +1799,11 @@ func (e *executor) executeGroupBy(ctx context.Context, index string, c *pql.Call
if err != nil {
return nil, errors.Wrap(err, "getting column")
}
if _, ok := child.Args["_field"].(string); !ok {
fieldName, ok := child.Args["_field"].(string)
if !ok {
return nil, errors.Errorf("%s call must have field with valid (string) field name. Got %v of type %[2]T", child.Name, child.Args["_field"])
}
f := idx.Field(child.Args["_field"].(string))
f := idx.Field(fieldName)
if f == nil {
return nil, ErrFieldNotFound
}

View file

@ -2997,7 +2997,7 @@ func TestExecutor_Execute_Remote_Row(t *testing.T) {
}
})
t.Run("groupbBy on ints with offset regression", func(t *testing.T) {
t.Run("groupBy on ints with offset regression", func(t *testing.T) {
_, err = c[0].API.CreateField(context.Background(), "i", "hint", pilosa.OptFieldTypeInt(1, 1000))
if err != nil {
t.Fatalf("creating field: %v", err)