-
Notifications
You must be signed in to change notification settings - Fork 791
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
refactor: convert Field::metadata
to HashMap
#3148
Conversation
d1b7e93
to
5f1d8e7
Compare
arrow-schema/src/field.rs
Outdated
match (self.metadata.get(k), other.metadata.get(k)) { | ||
(None, None) => {} | ||
(Some(_), None) => { | ||
return Ordering::Greater; |
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.
Is this the correct way round?
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.
Technically this doesn't matter since HashMap
s aren't ordered by default, so "who goes first" is implementation-defined by arrow, but I'll add a test.
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.
done
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'm not sure that the Ord implementation is correct, I'm also not sure we actually have any tests of it...
I would feel more comfortable with this, if we had a test that verified this
5f1d8e7
to
9367fe7
Compare
9367fe7
to
ba0f083
Compare
Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>
Benchmark runs are scheduled for baseline = 6f8187f and contender = 57f91f2. 57f91f2 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #2262.
Closes #3086
Rationale for this change
Consistent metadata types, smaller memory footprint, easier size calculations (see #3147).
What changes are included in this PR?
Field::metadata
is now aHashMap
instead of aBTreeMap
.Are there any user-facing changes?