vibhatha commented on code in PR #41636:
URL: https://github.com/apache/arrow/pull/41636#discussion_r1600836327
##########
java/vector/src/test/java/org/apache/arrow/vector/compare/TestRangeEqualsVisitor.java:
##########
@@ -132,6 +136,26 @@ public void testBaseVariableVectorRangeEquals() {
}
}
+ @Test
+ public void testBaseVariableViewVectorRangeEquals() {
+ try (final ViewVarCharVector vector1 = new ViewVarCharVector("varchar",
allocator);
+ final ViewVarCharVector vector2 = new ViewVarCharVector("varchar",
allocator)) {
+
+ setVector(vector1, STR1, STR2, STR4, STR3, STR2, STR5, STR1, STR6, STR1,
STR2, STR4);
+ setVector(vector2, STR1, STR2, STR4, STR3, STR2, STR5, STR1, STR6, STR1,
STR2, STR4);
+
+ RangeEqualsVisitor visitor = new RangeEqualsVisitor(vector1, vector2);
+ // inclusion of long string in the middle
+ assertTrue(visitor.rangeEquals(new Range(1, 1, 3)));
+ // 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)));
+ // unequal range
+ assertTrue(visitor.rangeEquals(new Range(8, 0, 3)));
Review Comment:
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.
--
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]