Skip to content
Discussion options

You must be logged in to vote

Is there a good way to convert an Arc to either Vec<Option>, where T is a Rust native type, or else straight to a polars::series::Series?

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:

  1. Downcast to PrimitiveArray
  2. Call PrimitiveArray::into_parts to get the scalar buffer (that holds the value)
  3. Call ScalarBuffer::to_vec

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Jefffrey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants