twest822 opened a new issue, #410: URL: https://github.com/apache/arrow-dotnet/issues/410
### Describe the bug, including details regarding any error messages, version, and platform. This property is currently implemented in PrimitiveArray.cs as ```C# Values => ValueBuffer.Span.CastTo<T>().Slice(Offset, Length); ``` but throws when T is larger than a byte because the order of `CastTo()` and `Slice()` is reversed. It should be ``` Values => ValueBuffer.Span.Slice(Offset, Length).CastTo<T>(); ``` The reason for this is `Length` ends up being the size of the underlying `ArrowBuffer`'s `Memory<byte>`. So, if `T` is larger than `byte`, `Slice()` is very likely to refuse to overrun end of the buffer because preceding it with `CastTo()` means the `Span`'s length is no longer measured in bytes. I haven't verified all of them but this should affect the derived classes `DoubleArray`, `FloatArray`, `Int16Array`, `Int32Array`, `Int64Array`, `UInt16Array`, `UInt32Array`, and `UInt64Array`. I've confirmed `UInt8Array.Values` works as expected, which should also be the case for `Int8Array`. -- 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]
