markjschreiber commented on code in PR #15106:
URL: https://github.com/apache/arrow/pull/15106#discussion_r1059136058
##########
java/algorithm/src/main/java/org/apache/arrow/algorithm/sort/VectorValueComparator.java:
##########
@@ -76,6 +88,10 @@ public void attachVector(V vector) {
public void attachVectors(V vector1, V vector2) {
this.vector1 = vector1;
this.vector2 = vector2;
+
+ final boolean v1MayHaveNulls =
vector1.getField().getFieldType().isNullable();
+ final boolean v2MayHaveNulls =
vector2.getField().getFieldType().isNullable();
Review Comment:
For the cases I have tested the java vectors seem to have a validity buffer
even when there can be no nulls. Depending on the `AllocationManager` this is
some form of buffer called `EMPTY` which is not null but cannot allocate memory
for items. It's not possible the test if the buffer is equal to one of these
because they are `private`
However, given that someone might change the implementation one day I will
include a check for a `null` validity buffer to catch this case as well.
--
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]