Merge branch 'master' into 1805-rows-call-format

This commit is contained in:
Yuce Tekol 2019-01-18 17:48:58 +03:00
commit ca7dc073ab
No known key found for this signature in database
GPG key ID: CB59E46D2FB90573
2 changed files with 19 additions and 0 deletions

View file

@ -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

View file

@ -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()