lidavidm commented on code in PR #15106:
URL: https://github.com/apache/arrow/pull/15106#discussion_r1058939428


##########
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:
   It may be preferable to check for the presence/absence of a validity buffer 
(I think Java does the same optimization as C++ here) - that'll cover cases 
where a nullable vector has no nulls, too. 
   
   It won't cover cases where a non-nullable vector has a validity buffer of 
all 1s, but as-is I'd say we may not want to enable this by default since 
nothing is really verifying that the data matches that part of the schema.



-- 
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]

Reply via email to