-
Notifications
You must be signed in to change notification settings - Fork 852
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
Reduce Cloning of Field #3955
Labels
arrow
Changes to the arrow crate
arrow-flight
Changes to the arrow-flight crate
enhancement
Any new improvement worthy of a entry in the changelog
parquet
Changes to the parquet crate
Comments
tustvold
added
the
enhancement
Any new improvement worthy of a entry in the changelog
label
Mar 26, 2023
tustvold
changed the title
Use Arc<Field> and Arc<[Field]> in DataType and Schema
Reduce Cloning of Field
Mar 26, 2023
This would be a potentially breaking change as #2239 made Schema's fields public... |
tustvold
added a commit
to tustvold/arrow-rs
that referenced
this issue
Mar 26, 2023
tustvold
added a commit
to tustvold/arrow-rs
that referenced
this issue
Mar 27, 2023
tustvold
added a commit
to tustvold/arrow-rs
that referenced
this issue
Mar 27, 2023
I believe @tustvold is working on this, so assigning to him |
tustvold
added a commit
to tustvold/arrow-rs
that referenced
this issue
Mar 28, 2023
This was referenced Mar 29, 2023
tustvold
added a commit
that referenced
this issue
Mar 30, 2023
tustvold
added a commit
to tustvold/arrow-rs
that referenced
this issue
Mar 30, 2023
tustvold
added a commit
that referenced
this issue
Mar 30, 2023
tustvold
added a commit
to tustvold/arrow-rs
that referenced
this issue
Mar 30, 2023
tustvold
added a commit
that referenced
this issue
Mar 30, 2023
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
arrow
Changes to the arrow crate
arrow-flight
Changes to the arrow-flight crate
enhancement
Any new improvement worthy of a entry in the changelog
parquet
Changes to the parquet crate
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Currently
DataType
andSchema
useBox<Field>
andVec<Field>
for nested types such asStructArray
, etc... This has a couple of drawbacks:Field
is not cheap to clone, involving cloningString
,DataType
, and potentiallyHashMap
DataType
comparison cannot make use of cheap pointer comparisonDataType::Struct
andSchema
is unnecessarily expensiveDescribe the solution you'd like
DataType
should be updated to useArc<Field>
instead ofBox<Field>
andArc<[Field]>
instead ofVec<Field>
.Similarly
Schema::new
should be updated to acceptimpl Into<Arc<[Field]>>
Describe alternatives you've considered
We could instead move the
Arc
inside ofField
i.e.struct Field(Arc<FieldInner>)
. This would potentially help codepaths that project or otherwise rearrange fields within aVec<Field>
but at the cost of an additional indirection. It is also unclear how to support this with the builder APIs added in #2024We could also introduce a FieldPtr type and use this where we currently use Field
Additional context
The text was updated successfully, but these errors were encountered: