atwam opened a new pull request, #9717:
URL: https://github.com/apache/arrow-rs/pull/9717

   # Which issue does this PR close?
   
   - Closes #9716 .
   
   # Rationale for this change
   
   Current version serializes a length-0 offsets buffer, and relies on the 
array constructor to set offsets to `[0]` for empty arrays. This does not 
conform with spec, which specifies that the offsets buffer should have `length 
+ 1` elements.
   
   This correctly serializes a length-1 offsets buffer containing `[0]`. I have 
left the current behavior of filling-in offsets with `[0]` for empty arrays, so 
that future versions can still read IPC files serialized by previous versions.
   
   # What changes are included in this PR?
   
   Added tests for serialization of empty arrays, ensuring length-1 offsets 
buffer. Fixed serialization of empty arrays.
   This fixes serialization of empty Binary/Utf8/List/LargeList (and Map) 
arrays.
   
   # Are these changes tested?
   
   Yes
   
   # Are there any user-facing changes?
   
   There should not be any breaking change for users. Serialized files for 
empty record batches will be slightly different. Older serialized files should 
still be read fine.


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