mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
fix container key computation for UnionRows call
This commit is contained in:
parent
97c84da566
commit
bfa59ffdc4
2 changed files with 10 additions and 2 deletions
|
|
@ -338,12 +338,11 @@ func (f *BitmapRowsUnion) ConsiderData(key FilterKey, data *Container) FilterRes
|
|||
// if necessary (because we expect the results to correspond to our shard
|
||||
// ID).
|
||||
func (f *BitmapRowsUnion) Results(shard uint64) *Bitmap {
|
||||
shard <<= shardwidth.Exponent
|
||||
b := NewSliceBitmap()
|
||||
for i, c := range f.c {
|
||||
// UnionInPlace might not have fixed count
|
||||
c.Repair()
|
||||
b.Containers.Put(uint64(i)+shard, c)
|
||||
b.Containers.Put(uint64(i)+shard*rowWidth, c)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,6 +125,15 @@ func TestRowsUnion(t *testing.T) {
|
|||
}
|
||||
out := u.Results(0)
|
||||
compareSlices(t, "sevenEleven", out.Slice(), expected)
|
||||
|
||||
// regression check (FB-1497)... make sure we're getting the
|
||||
// expected bits in a higher shard as well
|
||||
expected2 := make([]uint64, len(expected))
|
||||
for i, exp := range expected {
|
||||
expected2[i] = exp + 2*1<<shardwidth.Exponent
|
||||
}
|
||||
out2 := u.Results(2)
|
||||
compareSlices(t, "sevenEleven2", out2.Slice(), expected2)
|
||||
}
|
||||
|
||||
func TestBitmapFilter(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue