-
Notifications
You must be signed in to change notification settings - Fork 255
feat: Add IndexByName
and IndexById
to Namemapping
#1299
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
base: main
Are you sure you want to change the base?
Conversation
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.
A question and a clarification 💯
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.
Thanks @jonathanc-n , just finished first round of review, generally looks good.
@jdockerty @liurenjie1024 Thanks for the reviews. Should be fixed now! |
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.
Thank you @jonathanc-n for working on this and thank you @liurenjie1024 for the review.
Wait for @liurenjie1024 for another look.
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.
Thanks @jonathanc-n for this pr, just finished second round of review. There are still some problems to fix.
@@ -84,9 +133,187 @@ impl MappedField { | |||
} | |||
} | |||
|
|||
/// Recursively visits the entire name mapping using visitor | |||
fn visit_name_mapping<V>(namespace: &Vec<Arc<MappedField>>, visitor: &V) -> V::S |
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.
fn visit_name_mapping<V>(namespace: &Vec<Arc<MappedField>>, visitor: &V) -> V::S | |
fn visit_name_mapping<V>(namespace: &NameMapping, visitor: &V) -> V::S |
It's odd that the name is visit_name_mapping
while accepts a list of fields.
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 the return value should be a Result
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.
This is because when creating a new NameMapping
we call visit_schema
which creates an array of mapped fields which are then called on by index_by_id
+ index_by_name
Which issue does this PR close?
Build on #1116
What changes are included in this PR?
Adds IndexByName and index by id to name mapping
Are these changes tested?
Yes, unit tests