HawaiianSpork opened a new issue, #6997:
URL: https://github.com/apache/arrow-rs/issues/6997

   **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:
   ```rust
   
     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.


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