From 1ebd57628d9b94d0f88b97cb08027e9ebeb370d7 Mon Sep 17 00:00:00 2001 From: Cody Soyland Date: Fri, 13 Jul 2018 08:56:49 -0500 Subject: [PATCH] Merge pull request #1502 from codysoyland/export-row-intersect Re-export Row.Intersect (cherry picked from commit cdf5649ead94443b9ccf7c77b8a9ad4c8207baef) --- executor.go | 2 +- fragment.go | 12 ++++++------ row.go | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/executor.go b/executor.go index 43bd06f32..b56001c7a 100644 --- a/executor.go +++ b/executor.go @@ -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() diff --git a/fragment.go b/fragment.go index 8c5fbf787..6bfa9c4fd 100644 --- a/fragment.go +++ b/fragment.go @@ -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)) } } diff --git a/row.go b/row.go index 38ba24f9b..ed3672c47 100644 --- a/row.go +++ b/row.go @@ -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)