diff --git a/executor.go b/executor.go index d6b9ed46e..349604139 100644 --- a/executor.go +++ b/executor.go @@ -1022,7 +1022,7 @@ func (e *executor) executeRowsShard(ctx context.Context, index string, c *pql.Ca if columnID, ok, err := c.UintArg("column"); err != nil { return nil, err } else if ok { - return frag.rowsForColumnWithFilter(start, columnID, filters...), nil + return frag.rowsForColumn(start, columnID, filters...), nil } else { return frag.rows(start, filters...), nil } diff --git a/fragment.go b/fragment.go index 49850f800..6f6b376a5 100644 --- a/fragment.go +++ b/fragment.go @@ -1771,12 +1771,7 @@ type rowFilter func(rowID uint64) (bool, bool) // rows returns all rows by calling rowsWithFilter() // with a completely unrestrictive filter. - func (f *fragment) rows(start uint64, filters ...rowFilter) []uint64 { - return f.rowsWithFilter(start, filters...) -} - -func (f *fragment) rowsWithFilter(start uint64, filters ...rowFilter) []uint64 { startKey := rowToKey(start) i, _ := f.storage.Containers.Iterator(startKey) rows := make([]uint64, 0) @@ -1815,11 +1810,7 @@ func (f *fragment) rowsWithFilter(start uint64, filters ...rowFilter) []uint64 { return rows } -func (f *fragment) rowsForColumn(columnID uint64) []uint64 { - return f.rowsForColumnWithFilter(0, columnID) -} - -func (f *fragment) rowsForColumnWithFilter(start, columnID uint64, filters ...rowFilter) []uint64 { +func (f *fragment) rowsForColumn(start, columnID uint64, filters ...rowFilter) []uint64 { if columnID/ShardWidth != f.shard { panic(fmt.Sprintln("fragment.rowsForColumn should never be called with a columnID which is not in the fragment's shard", columnID, columnID/ShardWidth, f.shard)) @@ -2149,7 +2140,7 @@ func newRowsVector(f *fragment) *rowsVector { // Additionally, it returns true if a value was found, // otherwise it returns false. func (v *rowsVector) Get(colID uint64) (uint64, bool) { - rows := v.f.rowsForColumn(colID) + rows := v.f.rowsForColumn(0, colID) if len(rows) == 1 { return rows[0], true } diff --git a/fragment_internal_test.go b/fragment_internal_test.go index 70b6ad78e..f9d0bd999 100644 --- a/fragment_internal_test.go +++ b/fragment_internal_test.go @@ -1346,7 +1346,7 @@ func TestFragment_RowsIteration(t *testing.T) { t.Fatalf("Do not match %v %v", expectedAll, ids) } - ids = f.rowsForColumn(1) + ids = f.rowsForColumn(0, 1) if !reflect.DeepEqual(expectedOdd, ids) { t.Fatalf("Do not match %v %v", expectedOdd, ids) } @@ -1370,7 +1370,7 @@ func TestFragment_RowsIteration(t *testing.T) { t.Fatalf("Do not match %v %v", expected, ids) } - ids = f.rowsForColumn(66000) + ids = f.rowsForColumn(0, 66000) if !reflect.DeepEqual(expected, ids) { t.Fatalf("Do not match %v %v", expected, ids) } @@ -1392,7 +1392,7 @@ func TestFragment_RowsIteration(t *testing.T) { if !reflect.DeepEqual(expectedRows, ids) { t.Fatalf("Do not match %v %v", expectedRows, ids) } - ids = f.rowsForColumn(c) + ids = f.rowsForColumn(0, c) if !reflect.DeepEqual(expectedRows, ids) { t.Fatalf("Do not match %v %v", expectedRows, ids) }