CurtHagenlocher opened a new issue, #468:
URL: https://github.com/apache/arrow-dotnet/issues/468

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   `ListArray.GetSlicedValues(index)` returns `null` for a non-null element 
when the list's `Values` is an `ExtensionArray`, such as a `GuidArray` for a 
`list<arrow.uuid>`. It only slices when `Values is Array`:
   
   ```csharp
   if (!(Values is Array array))
   {
       return default;
   }
   ```
   
   `ExtensionArray` implements `IArrowArray` but doesn't derive from `Array`, 
so a list of extension values looks the same as a null element. 
`LargeListArray`, `FixedSizeListArray` and `LargeListViewArray` have the same 
check.
   
   Repro (v23.0.0):
   
   ```csharp
   GuidArray guids = new GuidArray.Builder().Append(Guid.NewGuid()).Build();
   ListArray list = new ListArray(
       new ListType(new Field("item", GuidType.Default, true)), 1,
       new ArrowBuffer.Builder<int>().Append(0).Append(1).Build(),
       guids, ArrowBuffer.Empty);
   
   IArrowArray values = list.GetSlicedValues(0); // null; expected a GuidArray 
of length 1
   ```
   
   A fix could slice any `IArrowArray` with `ArrowArrayFactory.Slice(Values, 
ValueOffsets[index], GetValueLength(index))`. That builds an extension array 
from the sliced `ArrayData`.
   
   Found while adding extension type support to the ADBC ADO.NET client 
(apache/arrow-adbc#4919), which works around it for now.
   
   ### 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