mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
fix BSI comparison match-all-but-one operation
This commit is contained in:
parent
058ed747c7
commit
d478dd9d94
1 changed files with 8 additions and 8 deletions
16
fragment.go
16
fragment.go
|
|
@ -1270,12 +1270,12 @@ func (f *fragment) rangeLTUnsigned(filter *Row, bitDepth uint, predicate uint64,
|
|||
return filter, nil
|
||||
case predicate == (1<<bitDepth)-1 && !allowEquality:
|
||||
// This query matches everything that is not (1<<bitDepth)-1.
|
||||
remaining := filter
|
||||
for i := uint(0); i < bitDepth && remaining.Any(); i++ {
|
||||
matches := NewRow()
|
||||
for i := uint(0); i < bitDepth; i++ {
|
||||
row := f.row(uint64(bsiOffsetBit + i))
|
||||
remaining = remaining.Intersect(row)
|
||||
matches = matches.Union(filter.Difference(row))
|
||||
}
|
||||
return remaining, nil
|
||||
return matches, nil
|
||||
case allowEquality:
|
||||
predicate++
|
||||
}
|
||||
|
|
@ -1345,12 +1345,12 @@ func (f *fragment) rangeGTUnsigned(filter *Row, bitDepth uint, predicate uint64,
|
|||
return filter, nil
|
||||
case predicate == 0 && !allowEquality:
|
||||
// This query matches everything that is not 0.
|
||||
remaining := filter
|
||||
for i := uint(0); i < bitDepth && remaining.Any(); i++ {
|
||||
matches := NewRow()
|
||||
for i := uint(0); i < bitDepth; i++ {
|
||||
row := f.row(uint64(bsiOffsetBit + i))
|
||||
remaining = remaining.Difference(row)
|
||||
matches = matches.Union(filter.Intersect(row))
|
||||
}
|
||||
return remaining, nil
|
||||
return matches, nil
|
||||
case allowEquality:
|
||||
predicate--
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue