diff --git a/executor.go b/executor.go index 0c9c75b16..f390f41af 100644 --- a/executor.go +++ b/executor.go @@ -1143,6 +1143,14 @@ func (e *executor) executeRowsShard(_ context.Context, index string, fieldName s if f == nil { return nil, ErrFieldNotFound } + + // Rows query does not currently support a `time` field that has + // `noStandardView: true`. + // TODO https://github.com/pilosa/pilosa/issues/1783 + if f.Type() == FieldTypeTime && f.options.NoStandardView { + return nil, errors.New("Rows() query on time field with no standard view is not currently supported") + } + frag := e.Holder.fragment(index, fieldName, viewStandard, shard) if frag == nil { return make(RowIDs, 0), nil diff --git a/executor_test.go b/executor_test.go index ac37055a6..4c2bbedd7 100644 --- a/executor_test.go +++ b/executor_test.go @@ -3066,6 +3066,17 @@ func TestExecutor_Execute_Rows(t *testing.T) { } } +func TestExecutor_Execute_RowsTime(t *testing.T) { + c := test.MustRunCluster(t, 1) + defer c.Close() + c.CreateField(t, "i", pilosa.IndexOptions{}, "t", pilosa.OptFieldTypeTime(pilosa.TimeQuantum("YMD"), true)) + + exp := "executing: Rows() query on time field with no standard view is not currently supported" + if _, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: `Rows(field=t)`}); err == nil || err.Error() != exp { + t.Fatalf("expected error: %s", exp) + } +} + func TestExecutor_Execute_Query_Error(t *testing.T) { c := test.MustRunCluster(t, 1) defer c.Close()