You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/09/28 18:32:27 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #14244: ARROW-17480 [Java] add setNull() to FieldVector interface

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


##########
java/vector/src/main/codegen/templates/UnionVector.java:
##########
@@ -851,4 +851,13 @@ public void setInitialCapacity(int valueCount, double density) {
         }
       }
     }
+
+  /**
+   * Set the element at the given index to null. For DenseUnionVector, it is a no-op as nulls are not supported at the
+   * top level, and isNull() always returns false. Nullability is only handled at the level of individual child vectors.
+   *
+   * @param index position of element
+   */
+  @Override
+  public void setNull(int index) {}

Review Comment:
   Or left unimplemented/abstract if possible



##########
java/vector/src/main/codegen/templates/DenseUnionVector.java:
##########
@@ -940,4 +940,13 @@ public void setInitialCapacity(int valueCount, double density) {
       }
     }
   }
+
+  /**
+   * Set the element at the given index to null. For DenseUnionVector, it is a no-op as nulls are not supported at the
+   * top level, and isNull() always returns false. Nullability is only handled at the level of individual child vectors.

Review Comment:
   Could it also delegate to a child?
   
   Also given this is a new method, I think an exception from the get-go is OK.



-- 
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: github-unsubscribe@arrow.apache.org

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