Skip to content

Conversation

@adamreeve
Copy link
Contributor

@adamreeve adamreeve commented Mar 26, 2024

Rationale for this change

See #40792, slicing a previously sliced array would return incorrect results.

What changes are included in this PR?

Removes the duplicated logic accounting for the current offset in ArrowArrayFactory, which is already handled by ArrayData.Slice.

Are these changes tested?

Yes, I added a unit test.

Are there any user-facing changes?

Yes, this is a user-facing bug fix.


public static IArrowArray Slice(IArrowArray array, int offset, int length)
{
if (offset > array.Length)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check and the length = Math.Min(... adjustment below are also both accounted for in ArrayData.Slice, so I removed them too.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Mar 26, 2024
@CurtHagenlocher CurtHagenlocher merged commit 4b0f3fd into apache:main Mar 26, 2024
@CurtHagenlocher CurtHagenlocher removed the awaiting committer review Awaiting committer review label Mar 26, 2024
@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Mar 26, 2024
@adamreeve adamreeve deleted the double_slice branch March 26, 2024 20:07
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit 4b0f3fd.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants