rymurr commented on a change in pull request #7290:
URL: https://github.com/apache/arrow/pull/7290#discussion_r452084718



##########
File path: java/vector/src/main/codegen/templates/DenseUnionVector.java
##########
@@ -283,7 +285,7 @@ public long getValidityBufferAddress() {
   public ArrowBuf getDataBuffer() { throw new UnsupportedOperationException(); 
}
 
   public StructVector getStruct(byte typeId) {
-    StructVector structVector = (StructVector) childVectors[typeId];
+    StructVector structVector = typeId < 0 ? null : (StructVector) 
childVectors[typeId];

Review comment:
       correct, its a bit strange as there is no way to tell between null and 
not yet allocated. One of hte only benefits of a separate validity buffer. I 
thought this was a good compromise though I dont love it.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to