Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrow IPC Writer Panics for sliced nested arrays #6997

Closed
Tracked by #6929
HawaiianSpork opened this issue Jan 20, 2025 · 1 comment · Fixed by #6998
Closed
Tracked by #6929

Arrow IPC Writer Panics for sliced nested arrays #6997

HawaiianSpork opened this issue Jan 20, 2025 · 1 comment · Fixed by #6998
Labels
arrow Changes to the arrow crate bug

Comments

@HawaiianSpork
Copy link
Contributor

Describe the bug
I introduced a regression with #6805 that causes the writer to panic if the offset slice is zero and the slice length * 2 is within the end of the original array.

To Reproduce
Example code which reproduces the error:

  let mut ls = GenericListBuilder::<i32, _>::new(UInt32Builder::new());
  // ls = [[], [35, 42]
  ls.append(true);
  ls.values().append_value(35);
  ls.values().append_value(42);
  ls.append(true);
  let original_list = ls.finish();
  let original_data = original_list.into_data();

  let slice_data = original_data.slice(1, 1);
  let (new_offsets, original_start, length) = reencode_offsets::<i32>(&slice_data.buffers()[0], &slice_data);
  // panic

Expected behavior
Code shouldn't panic and should return the slices.

Additional context
Pull request incoming. The code is just making the slice twice as large as it should.

@alamb
Copy link
Contributor

alamb commented Jan 27, 2025

label_issue.py automatically added labels {'arrow'} from #6998

@alamb alamb changed the title Arrow IPC Writer Panics If the slice offset is starts with zero Arrow IPC Writer Panics for deeply nested types If the slice offset is does not start with zero Jan 27, 2025
@alamb alamb changed the title Arrow IPC Writer Panics for deeply nested types If the slice offset is does not start with zero Arrow IPC Writer Panics for sliced nested arrays Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants