zeroshade commented on issue #13977:
URL: https://github.com/apache/arrow/issues/13977#issuecomment-1230911932
Hi @ftamhar,
The issue with that sort of an interface is that it is actually expensive to
create and there isn't always a reasonable representation of the array that
would fit that (for example, complex types like Structs / Lists etc.)
The expected way to interact with the `Array` interface is to type switch
(or otherwise switch on the type) and then use the methods that are provided in
those cases (for example all the numeric primitives offer a `*Values()` method
which returns a native slice of the appropriate type (e.g. `array.Int32` has
`Int32Values() []int32`).
Creating a `[]interface{}` would necessitate a copy of the data and wouldn't
work in any reasonable way for complex types. Can you provide details on the
use case you're dealing with where you need a `[]interface{}`?
--
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]