diff --git a/executor_test.go b/executor_test.go index d1ae63cb4..4a39a7713 100644 --- a/executor_test.go +++ b/executor_test.go @@ -4742,6 +4742,10 @@ func TestExecutor_Execute_Rows_Keys(t *testing.T) { q: `Rows(f, previous="1", limit=0, column="0")`, exp: []string{}, }, + { + q: `Rows(f, like="__")`, + exp: []string{"10", "11", "12", "13", "14", "15", "16", "17", "18"}, + }, } for i, test := range tests { @@ -5843,6 +5847,31 @@ func TestExecutor_Execute_TopNDistinct(t *testing.T) { }) } +func Test_Executor_Execute_UnionRows(t *testing.T) { + c := test.MustRunCluster(t, 2) + defer c.Close() + + c.CreateField(t, "i", pilosa.IndexOptions{}, "s", + pilosa.OptFieldTypeSet(pilosa.CacheTypeRanked, 50000), + ) + + // Populate data. + c.Query(t, "i", ` + Set(0, s=1) + Set(1, s=2) + Set(2, s=3) + Set(3, s=1) + Set(3, s=5) + `) + + if res := c.Query(t, "i", `Count(UnionRows(TopN(s, n=1)))`); res.Results[0] != uint64(2) { + t.Errorf("expected 2 columns, got %v", res.Results[0]) + } + if res := c.Query(t, "i", `Count(UnionRows(Rows(s)))`); res.Results[0] != uint64(4) { + t.Errorf("expected 4 columns, got %v", res.Results[0]) + } +} + func TestTimelessClearRegression(t *testing.T) { data, err := ioutil.ReadFile("testdata/timeRegressionSchema.json") if err != nil { diff --git a/like.go b/like.go index cb66a9d91..d3fbebe54 100644 --- a/like.go +++ b/like.go @@ -1,3 +1,17 @@ +// Copyright 2020 Pilosa Corp. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package pilosa import ( diff --git a/like_test.go b/like_test.go index b6aee7c78..1382901ec 100644 --- a/like_test.go +++ b/like_test.go @@ -1,3 +1,17 @@ +// Copyright 2020 Pilosa Corp. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package pilosa import (