New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RangeBitmap inserts new values that occur unexpected results when building a RangeBitamp.Appender. #601
Comments
It’s hard to say whether this is a user error or a bad API, therefore whether it’s just “not a bug” or a “feature request” but this isn’t the way the appended was expected to be used. The appended should be cleared by calling clear, and then you should put all the values back in. However, I think your usage makes sense and could be supported without breaking existing use cases, so I will take a look at making it work the way you expect. |
Sincere thanks for your reply, and I'm sorry for marking this question as a bug. In many cases, there is a need to add new elements again after building RangeBitmap. The default method of building the range bitmap (clearing the appender then putting all the values back in) will have a high construction cost if the appender has previously maintained a lot of data and I just need to add a small number of new elements. Therefore, I am eagerly anticipating the addition of this feature to RangeBitmap. Sorry to disturb you. Wish you all the best in your work. |
Yes, I understand the motivation. It just wasn't relevant to its original use case. I should get around to it within a week or so. |
@Josehokec can you describe a concrete use case for this functionality, something more involved than a test program? Why would you want a |
I'm sorry I didn't see this email until now. Currently, I use RangeBitmap to filter some tuples according to multiple attribute range constraints to speed up the execution of SQL statements (RangeBitmap has excellent query performance). Using RangeBitmap in processing complex query statements can improve performance greatly. For my database table, there is a need to insert new tuples (although the frequency of inserting elements is very low). However, after calling the I'm hoping that after calling the I apologize for sending this email so late. |
Essentially you want a way to append to an existing index when you add some rows. So long as it’s only appending, this can be made to work, but it might be better not to make the appender reusable and instead wrap the existing index, e.g. var appender = Appender.wrap(existingIndex); Keeping the appender around will hang on to a lot of memory and making the appender work just in case the user wants to reuse it may incur overhead/cause bugs in the existing usage in Apache Pinot. |
@richardstartin I have marked this as a possible enhancement. |
Describe the bug
After using the appender build RangeBitmap, insert new values, then build a RangeBitmap again, there will occur unexpected results.
To Reproduce
**My test file: **
These are the output results:
--------Range Bitmap Experiments1--------
lte5 old roaring bitmap values: 0 1
lte5 new roaring bitmap values: 0 1
gte3 new roaring bitmap values: 2 3 4
gte4 new roaring bitmap values: 2 3 4
--------Range Bitmap Experiments2--------
gte4 roaring bitmap values: 3 4
lte5 roaring bitmap values: 0 1 2 3 4
RoaringBitmap version:
0.9.35
Java version:
JDK 11
The text was updated successfully, but these errors were encountered: