Merge pull request #1502 from codysoyland/export-row-intersect

Re-export Row.Intersect

(cherry picked from commit cdf5649ead)
This commit is contained in:
Cody Soyland 2018-07-13 08:56:49 -05:00 committed by Cody Soyland
parent 8abdd38e30
commit 1ebd57628d
3 changed files with 9 additions and 9 deletions

View file

@ -712,7 +712,7 @@ func (e *executor) executeIntersectShard(ctx context.Context, index string, c *p
if i == 0 {
other = row
} else {
other = other.intersect(row)
other = other.Intersect(row)
}
}
other.invalidateCount()

View file

@ -598,7 +598,7 @@ func (f *fragment) min(filter *Row, bitDepth uint) (min, count uint64, err error
consider := f.row(uint64(bitDepth))
if filter != nil {
consider = consider.intersect(filter)
consider = consider.Intersect(filter)
}
// If there are no columns to consider, return early.
@ -631,7 +631,7 @@ func (f *fragment) max(filter *Row, bitDepth uint) (max, count uint64, err error
consider := f.row(uint64(bitDepth))
if filter != nil {
consider = consider.intersect(filter)
consider = consider.Intersect(filter)
}
// If there are no columns to consider, return early.
@ -643,7 +643,7 @@ func (f *fragment) max(filter *Row, bitDepth uint) (max, count uint64, err error
ii := i - 1 // allow for uint range: (bitDepth-1) to 0
row := f.row(uint64(ii))
x := row.intersect(consider)
x := row.Intersect(consider)
count = x.Count()
if count > 0 {
max += (1 << ii)
@ -682,7 +682,7 @@ func (f *fragment) rangeEQ(bitDepth uint, predicate uint64) (*Row, error) {
bit := (predicate >> uint(i)) & 1
if bit == 1 {
b = b.intersect(row)
b = b.Intersect(row)
} else {
b = b.Difference(row)
}
@ -783,7 +783,7 @@ func (f *fragment) rangeGT(bitDepth uint, predicate uint64, allowEquality bool)
// 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 {
keep = keep.Union(b.intersect(row))
keep = keep.Union(b.Intersect(row))
}
}
@ -815,7 +815,7 @@ func (f *fragment) rangeBetween(bitDepth uint, predicateMin, predicateMax uint64
// 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))
keep1 = keep1.Union(b.Intersect(row))
}
}

4
row.go
View file

@ -82,8 +82,8 @@ func (r *Row) intersectionCount(other *Row) uint64 {
return n
}
// intersect returns the itersection of r and other.
func (r *Row) intersect(other *Row) *Row {
// Intersect returns the itersection of r and other.
func (r *Row) Intersect(other *Row) *Row {
var segments []rowSegment
itr := newMergeSegmentIterator(r.segments, other.segments)