Skip to content
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

Merged
merged 21 commits into from
Dec 24, 2024
Merged

feat: update geoarrow and duckdb #562

merged 21 commits into from
Dec 24, 2024

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented Dec 6, 2024

@gadomski gadomski marked this pull request as ready for review December 24, 2024 19:14
@gadomski gadomski self-assigned this Dec 24, 2024
@gadomski gadomski merged commit 0a5a045 into main Dec 24, 2024
17 checks passed
@gadomski gadomski deleted the issues/385-duckdb branch December 24, 2024 19:46
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);
Copy link
Collaborator

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

Copy link
Member Author

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?

Copy link
Collaborator

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 Arcs, so the clone() just increases some ref counts.

gadomski added a commit that referenced this pull request Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to duckdb v1.1
2 participants