Replies: 2 comments
-
I'm running into the same issue. Have you found a solution? |
Beta Was this translation helpful? Give feedback.
0 replies
-
The underlying representation is Vec with a separate structure for nulls, so you can't directly go to Vec<Option> The way to convert an Array to a Vec is:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Is there a good way to convert an
Arc<dyn Array>
to eitherVec<Option<T>>
, where T is a Rust native type, or else straight to apolars::series::Series
?So far the rough solution I've come up with looks as follows:
However, there are at least 3 problems with fully implementing this approach:
I feel like there may well be a better approach than the one sketched above, so if anyone has any pointers or suggestions I'd be very grateful.
(For context, the arrow arrays are coming from a SQL query executed by connectorx, and I'm trying to find a way to convert this column data into a
polars::data frame::DataFrame
for subsequent manipulation. I know connectorx has a .polars() solution, and that connectorx can also return data as arrow2 arrays, which is a lightweight implementation of arrow used by Polars, but then I'm tied to using the same version of Polars used by connectorx, which is very old at this point, and I think going in the direction I currently am will allow me to decouple the Polars version from connectorx and get access to more recent and powerful versions of Polars.)Thanks!
Dan
Beta Was this translation helpful? Give feedback.
All reactions