pravindra commented on a change in pull request #7106:
URL: https://github.com/apache/arrow/pull/7106#discussion_r420070789



##########
File path: java/vector/src/main/codegen/templates/UnionListWriter.java
##########
@@ -180,7 +180,7 @@ public void write(DecimalHolder holder) {
 
   @Override
   public void writeNull() {
-    writer.setPosition(writer.idx()+1);

Review comment:
       can you please add a check here 
   
   if (writer.idx() >= (idx() + 1) * listSize) {
         throw new IllegalStateException(String.format("values at index %s is 
greater than listSize %s", idx(), listSize));
       }

##########
File path: java/vector/src/main/codegen/templates/StructWriters.java
##########
@@ -196,6 +196,15 @@ public void setPosition(int index) {
     }
   }
 
+  <#if mode="Nullable">
+  @Override
+  public void writeNull() {
+    container.setNull(idx());
+    setValueCount(idx()+1);

Review comment:
       is the setValueCount required ?  it should be done after all mutations 
to the vector are done.




----------------------------------------------------------------
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:
[email protected]


Reply via email to