mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Merge pull request #1826 from travisturner/error-time-nostandardview
raise an error on Rows() query against a time field with noStandardView: true
This commit is contained in:
commit
86e9456afc
2 changed files with 19 additions and 0 deletions
|
|
@ -1138,6 +1138,14 @@ func (e *executor) executeRowsShard(_ context.Context, index string, c *pql.Call
|
|||
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
|
||||
|
|
|
|||
|
|
@ -3059,6 +3059,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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue