-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
GH-40943: [Java] Implement RangeEqualsVisitor for StringView #41636
GH-40943: [Java] Implement RangeEqualsVisitor for StringView #41636
Conversation
java/vector/src/main/java/org/apache/arrow/vector/BaseVariableWidthViewVector.java
Show resolved
Hide resolved
java/vector/src/main/java/org/apache/arrow/vector/compare/RangeEqualsVisitor.java
Outdated
Show resolved
Hide resolved
java/vector/src/main/java/org/apache/arrow/vector/compare/RangeEqualsVisitor.java
Outdated
Show resolved
Hide resolved
java/vector/src/main/java/org/apache/arrow/vector/compare/RangeEqualsVisitor.java
Outdated
Show resolved
Hide resolved
// inclusion of long string at the start | ||
assertTrue(visitor.rangeEquals(new Range(2, 2, 4))); | ||
// inclusion of long string at the end | ||
assertTrue(visitor.rangeEquals(new Range(4, 4, 4))); |
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.
we should also test nulls, and ranges that should not be equal
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.
I added one case for that.
d8d140f
to
ec55b8b
Compare
// unequal range | ||
assertTrue(visitor.rangeEquals(new Range(8, 0, 3))); |
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.
....they're still equal. Let's test ranges that are not supposed to be equal.
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.
ah right! 🙂 I misunderstood.
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.
added a few not equal cases for each category except for inclusion of long string at the end
, since it is not possible to have that case.
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.
added null cases, there is a bit of code duplication in testing the ranges, I left it that way for the readability.
I am working on adding the null one... |
return false; | ||
} | ||
|
||
if (!isNull) { |
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.
@lidavidm there was an unnecessary looping happened. So I added this. Sorry I missed this earlier.
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.
nit: it's clearer to do if (isNull) { continue; }
return false; | ||
} | ||
|
||
if (!isNull) { |
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.
nit: it's clearer to do if (isNull) { continue; }
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 1c15c88. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 10 possible false positives for unstable benchmarks that are known to sometimes produce them. |
…pache#41636) ### Rationale for this change Adding `RangeEqualsVisitor` for StringView as discussed in apache#40943. ### What changes are included in this PR? Including `RangeEqualsVisitor` visitor method and test cases to validate it. ### Are these changes tested? Yes ### Are there any user-facing changes? No * GitHub Issue: apache#40943 Authored-by: Vibhatha Abeykoon <vibhatha@gmail.com> Signed-off-by: David Li <li.davidm96@gmail.com>
Rationale for this change
Adding
RangeEqualsVisitor
for StringView as discussed in #40943.What changes are included in this PR?
Including
RangeEqualsVisitor
visitor method and test cases to validate it.Are these changes tested?
Yes
Are there any user-facing changes?
No
RangeEqualsVisitor
for StringView #40943