eerhardt commented on issue #12049:
URL: https://github.com/apache/arrow/issues/12049#issuecomment-1006729352
```
var col = readBatch.Column(0);
```
Here `col` is an `IArrowArray`. In order to read the values from an array,
you need to know which type of data is contained in the array. You can do `as`
or `is` type checks for each type, or if you know the type, you can just cast.
In your example above, it is an `Int32Array`, so casting to that you can now
get the `.Values` property, which is a `ReadOnlySpan<int>` that you can loop
through:
```C#
IArrowArray col = readBatch.Column(0);
Int32Array intArray = (Int32Array)col;
ReadOnlySpan<int> values = intArray.Values;
for (int i = 0; i < values.Length; i++)
{
Console.WriteLine(values[i]);
}
```
--
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]