adamreeve opened a new issue, #40792:
URL: https://github.com/apache/arrow/issues/40792

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   Test to reproduce:
   ```c#
   [Fact]
   public void RecursiveArraySlice()
   {
       var initialValues = Enumerable.Range(0, 100).ToArray();
       var array = new Int32Array.Builder().AppendRange(initialValues).Build();
   
       var sliced = (Int32Array) array.Slice(20, 30);
       var slicedAgain = (Int32Array) sliced.Slice(5, 10);
   
       Assert.Equal(25, slicedAgain.Offset);  // Fails with "Actual:   45"
       Assert.Equal(10, slicedAgain.Length);
       Assert.Equal(
           initialValues.Skip(25).Take(10).Select(val => (int?) val).ToArray(),
           (IReadOnlyList<int?>) slicedAgain);
   }
   ```
   
   This is because the current offset is accounted for twice, first at 
https://github.com/apache/arrow/blob/e3b0bd1feb63d59cd6fb553af976449397b8348e/csharp/src/Apache.Arrow/Arrays/ArrowArrayFactory.cs#L113
   Then again at 
https://github.com/apache/arrow/blob/e3b0bd1feb63d59cd6fb553af976449397b8348e/csharp/src/Apache.Arrow/Arrays/ArrayData.cs#L112
   
   This only works if the offset is zero.
   
   ### Component(s)
   
   C#


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