-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update geoarrow and duckdb #562
Conversation
gadomski
commented
Dec 6, 2024
•
edited
Loading
edited
- Closes Upgrade to duckdb v1.1 #385
if let Some((index, _)) = record_batch.schema().column_with_name("geometry") { | ||
let geometry_column = record_batch.remove_column(index); | ||
let binary_array: GenericByteArray<GenericBinaryType<i32>> = | ||
arrow::array::downcast_array(&geometry_column); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also it's cleaner to use geometry_column.as_binary<i32>()
here: https://docs.rs/arrow/latest/arrow/array/cast/trait.AsArray.html#method.as_binary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used downcast_array
because I wanted an owned array in the next line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it's simpler/more canonical to use geometry_column.as_binary<i32>().clone()
. All the data is under Arc
s, so the clone()
just increases some ref counts.