ViggoC commented on code in PR #761:
URL: https://github.com/apache/arrow-java/pull/761#discussion_r2099417700
##########
vector/src/main/java/org/apache/arrow/vector/compare/RangeEqualsVisitor.java:
##########
@@ -270,35 +271,24 @@ protected boolean compareRunEndEncodedVectors(Range
range) {
RunEndEncodedVector leftVector = (RunEndEncodedVector) left;
RunEndEncodedVector rightVector = (RunEndEncodedVector) right;
- final int leftRangeEnd = range.getLeftStart() + range.getLength();
- final int rightRangeEnd = range.getRightStart() + range.getLength();
+ final RunEndEncodedVector.RangeIterator leftIterator =
+ new RangeIterator(leftVector, range.getLeftStart(), range.getLength());
+ final RunEndEncodedVector.RangeIterator rightIterator =
+ new RangeIterator(rightVector, range.getRightStart(),
range.getLength());
FieldVector leftValuesVector = leftVector.getValuesVector();
FieldVector rightValuesVector = rightVector.getValuesVector();
RangeEqualsVisitor innerVisitor = createInnerVisitor(leftValuesVector,
rightValuesVector, null);
- int leftLogicalIndex = range.getLeftStart();
- int rightLogicalIndex = range.getRightStart();
+ while (leftIterator.nextRun() | rightIterator.nextRun()) {
Review Comment:
@lidavidm According to your suggestion, I should change it to `while
(leftIterator.nextRun() && rightIterator.nextRun())` instead of `while
(leftIterator.nextRun() || rightIterator.nextRun())`. The short-circuit feature
of '||' will make only leftIterator move forward, while right stays still.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]