zeroshade commented on issue #41284: URL: https://github.com/apache/arrow/issues/41284#issuecomment-2101031278
> Tests requirement, it'll be removed soon (we need to sort rows in tests, so we slice to single-row records). I've been wanting to add sort functions to the compute package (which already has Take & Filter).... if you want to try your hand at contributing sort functions, I'd be happy to review them and it would solve your issue of making single-row slices :) > I noticed that when working with sliced struct arrays the arr.Data().Offset() would return unusable info. That's because the underlying arrays are sliced, too, so constructing the struct array this way fails (you have to use 0). I'd be curious what a minimal reproducer of this might look like. In theory for a sliced array, only the *top-level* needs the offset. So if your child arrays are already sliced, then it makes sense you don't need to have an offset in the top struct as offsets are only related to the Array they are attached to. So i can think of three possible situations here: * There's a bug in the slicing logic that propagated an offset to children during slicing when it shouldn't have * There's a bug in the accessing logic (IsValid/IsNull/Value/etc.) which didn't properly handle the offset somewhere * There's a mistake somewhere in the code when constructing the arrays regarding handling what should or shouldn't be sliced and where -- 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]
