jaideeppyne commented on PR #10835:
URL: https://github.com/apache/arrow-rs/pull/10835#issuecomment-5433257518

   You're right, thanks for catching that. My version left `self.offset` on the 
parent, so for a struct that already carries an offset (an FFI import, say) 
`From<ArrayData> for StructArray` still re-windowed children I'd already 
windowed — same `(offset + length) <= self.len()` panic, just moved to a rarer 
input.
   
   Per the `ArrayData::offset` docs you added in #10838, the struct offset 
composes cumulatively with each child's, so the window has to be recorded once. 
I've pushed `self.offset + offset` down into the children and reset the parent 
offset to 0, which makes lines 437-439 a no-op.
   
   I did try the simpler "only bump the parent offset, leave children alone" 
version first, but the IPC writer serialises struct `child_data` without 
applying the parent offset, so that wrote wrong values for sliced maps — hence 
keeping the window on the children. Added a test for slicing struct data that 
already has an offset.
   


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