-
Notifications
You must be signed in to change notification settings - Fork 1k
Add common utility function ScanUtil.splityKeyRangesByBoundaries() #485
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
Conversation
… wrong result when two key ranges have the same upper bound values but one is inclusive and another is exclusive
phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/test/java/org/apache/phoenix/query/SplitKeyRangesByBoundariesTest.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/test/java/org/apache/phoenix/query/SplitKeyRangesByBoundariesTest.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/test/java/org/apache/phoenix/query/SplitKeyRangesByBoundariesTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, sorry I wasn't clear what I meant when i said boundaries couldn't be size 0. What I meant was that the elements of boundaries, the individual byte[]'s those cannot be length 0. And maybe add a comment to that.
OK, I'll a comment. |
twdsilva
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, just had one minor comment.
| * @param keyRanges | ||
| * The key ranges to split along the given boundaries. Coalesced. | ||
| * @return | ||
| * List<Pair<RangeIndex, Query Key Range List in this range>>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be List<Pair<BoundaryIndex, Query Key Range List in this boundary>> ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@twdsilva , N boundaries split the key space into N+1 ranges. Here each pair is the index of of such a range and the query key ranges belongs to that range. Probably still use <RangeIndex, Query Key Range List in the range>? Let me add more comment and you can decide how it will be more accurate.
|
+1, can you please squash your changes and I will get this committed. |
Change the return type of splitKeyRangesByBoundaries() from List<KeyRange> to List<Pair<Integer, List<KeyRange>>>. Handled feedback.
|
@twdsilva, just squashed. Could you check what I did is correct? |
What does this PR do?
Which problem(s) does it fix and how? What does this PR add?
Where should the reviewer start?
Explain what should be set-up first in order to get the review started. Which page has to be viewed etc.
How should this be manually tested?
Documents
Screenshots (if appropriate)
If this PR changes something that concerns UI changes, please post before and after screenshots here.
Other documents
If you have any documents that have anything to do with this PR.
Who should be notified?
What should happen on deployment? (check all that apply)
Questions: