diff --git a/executor.go b/executor.go index 919a2ea76..89376914f 100644 --- a/executor.go +++ b/executor.go @@ -2592,10 +2592,8 @@ func (e *executor) executeRowsShard(ctx context.Context, qcx *Qcx, index string, // in order to represent `Rows` for the field. var views = []string{viewStandard} - // Handle `int` and `time` fields. switch f.Type() { - case FieldTypeInt: - return nil, errors.New("int fields not supported by Rows() query") + case FieldTypeSet, FieldTypeMutex: case FieldTypeTime: var err error @@ -2657,6 +2655,8 @@ func (e *executor) executeRowsShard(ctx context.Context, qcx *Qcx, index string, // Determine the views based on the specified time range. views = viewsByTimeRange(viewStandard, fromTime, toTime, q) } + default: + return nil, errors.Errorf("%s fields not supported by Rows() query", f.Type()) } start := uint64(0) diff --git a/executor_test.go b/executor_test.go index d173ecd1b..e379daf7d 100644 --- a/executor_test.go +++ b/executor_test.go @@ -4851,6 +4851,8 @@ func TestExecutor_Execute_Query_Error(t *testing.T) { defer c.Close() c.CreateField(t, "i", pilosa.IndexOptions{}, "general") c.CreateField(t, "i", pilosa.IndexOptions{}, "integer", pilosa.OptFieldTypeInt(-1000, 1000)) + c.CreateField(t, "i", pilosa.IndexOptions{}, "decimal", pilosa.OptFieldTypeDecimal(2)) + c.CreateField(t, "i", pilosa.IndexOptions{}, "bool", pilosa.OptFieldTypeBool()) tests := []struct { query string @@ -4884,6 +4886,18 @@ func TestExecutor_Execute_Query_Error(t *testing.T) { query: "GroupBy(Rows(integer), prev=-1)", error: "unknown arg 'prev'", }, + { + query: "Rows(integer)", + error: "int fields not supported by Rows() query", + }, + { + query: "Rows(decimal)", + error: "decimal fields not supported by Rows() query", + }, + { + query: "Rows(bool)", + error: "bool fields not supported by Rows() query", + }, } for i, test := range tests {