You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/09/23 09:21:05 UTC
[GitHub] [pinot] richardstartin commented on a diff in pull request #9453: Fix the range check for range index on raw column
richardstartin commented on code in PR #9453:
URL: https://github.com/apache/pinot/pull/9453#discussion_r978436582
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/BitSlicedRangeIndexReader.java:
##########
@@ -122,35 +157,39 @@ public ImmutableRoaringBitmap getPartiallyMatchingDocIds(double min, double max)
}
private ImmutableRoaringBitmap queryRangeBitmap(long min, long max, long columnMax) {
- RangeBitmap rangeBitmap = mapRangeBitmap();
- if (Long.compareUnsigned(max, columnMax) < 0) {
- if (Long.compareUnsigned(min, 0) > 0) {
- return rangeBitmap.between(min, max).toMutableRoaringBitmap();
- }
- return rangeBitmap.lte(max).toMutableRoaringBitmap();
- } else {
- if (Long.compareUnsigned(min, 0) > 0) {
- return rangeBitmap.gte(min).toMutableRoaringBitmap();
- }
+ // Compare unsigned
+ boolean lowerUnbounded = min + Long.MIN_VALUE <= Long.MIN_VALUE;
+ boolean upperUnbounded = max + Long.MIN_VALUE >= columnMax + Long.MIN_VALUE;
+ if (lowerUnbounded && upperUnbounded) {
MutableRoaringBitmap all = new MutableRoaringBitmap();
- all.add(0, _numDocs);
+ all.add(0L, _numDocs);
return all;
}
+ RangeBitmap rangeBitmap = mapRangeBitmap();
+ if (lowerUnbounded) {
+ return rangeBitmap.lte(max).toMutableRoaringBitmap();
+ }
+ if (upperUnbounded) {
+ return rangeBitmap.gte(min).toMutableRoaringBitmap();
+ }
+ return rangeBitmap.between(min, max).toMutableRoaringBitmap();
Review Comment:
These are non-functional changes and I don't think they are improvements, I suggest removing them to remove noise in the PR (which is an important bug-fix)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org