mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-09 04:17:51 +00:00
few more fixes to bsi comments
This commit is contained in:
parent
4ef266e5cc
commit
b878ab347a
1 changed files with 6 additions and 6 deletions
12
fragment.go
12
fragment.go
|
|
@ -698,7 +698,7 @@ func (f *Fragment) fieldRangeEQ(bitDepth uint, predicate uint64) (*Row, error) {
|
|||
// Start with set of columns with values set.
|
||||
b := f.Row(uint64(bitDepth))
|
||||
|
||||
// Filter any columns that don't match the current column value.
|
||||
// Filter any bits that don't match the current bit value.
|
||||
for i := int(bitDepth - 1); i >= 0; i-- {
|
||||
row := f.Row(uint64(i))
|
||||
bit := (predicate >> uint(i)) & 1
|
||||
|
|
@ -735,7 +735,7 @@ func (f *Fragment) fieldRangeLT(bitDepth uint, predicate uint64, allowEquality b
|
|||
// Start with set of columns with values set.
|
||||
b := f.Row(uint64(bitDepth))
|
||||
|
||||
// Filter any columns that don't match the current column value.
|
||||
// Filter any bits that don't match the current bit value.
|
||||
leadingZeros := true
|
||||
for i := int(bitDepth - 1); i >= 0; i-- {
|
||||
row := f.Row(uint64(i))
|
||||
|
|
@ -823,18 +823,18 @@ func (f *Fragment) FieldRangeBetween(bitDepth uint, predicateMin, predicateMax u
|
|||
keep1 := NewRow() // GTE
|
||||
keep2 := NewRow() // LTE
|
||||
|
||||
// Filter any columns that don't match the current column value.
|
||||
// Filter any bits that don't match the current bit value.
|
||||
for i := int(bitDepth - 1); i >= 0; i-- {
|
||||
row := f.Row(uint64(i))
|
||||
bit1 := (predicateMin >> uint(i)) & 1
|
||||
bit2 := (predicateMax >> uint(i)) & 1
|
||||
|
||||
// GTE predicateMin
|
||||
// If bit is set then remove all unset bits not already kept.
|
||||
// If bit is set then remove all unset columns not already kept.
|
||||
if bit1 == 1 {
|
||||
b = b.Difference(b.Difference(row).Difference(keep1))
|
||||
} else {
|
||||
// If bit is unset then add bits with set bit to keep.
|
||||
// If bit is unset then add columns with set bit to keep.
|
||||
// Don't bother to compute this on the final iteration.
|
||||
if i > 0 {
|
||||
keep1 = keep1.Union(b.Intersect(row))
|
||||
|
|
@ -846,7 +846,7 @@ func (f *Fragment) FieldRangeBetween(bitDepth uint, predicateMin, predicateMax u
|
|||
if bit2 == 0 {
|
||||
b = b.Difference(row.Difference(keep2))
|
||||
} else {
|
||||
// If bit is set then add bits for set bits to exclude.
|
||||
// If bit is set then add columns for set bits to exclude.
|
||||
// Don't bother to compute this on the final iteration.
|
||||
if i > 0 {
|
||||
keep2 = keep2.Union(b.Difference(row))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue