-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
AVRO-3917: [Rust] take field aliases into account when calculating schema compatibilities #2633
Merged
martin-g
merged 2 commits into
apache:main
from
marcosschroh:fix/check-aliases-when-calculating-schema-compatibility
Dec 12, 2023
Merged
AVRO-3917: [Rust] take field aliases into account when calculating schema compatibilities #2633
martin-g
merged 2 commits into
apache:main
from
marcosschroh:fix/check-aliases-when-calculating-schema-compatibility
Dec 12, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marcosschroh
force-pushed
the
fix/check-aliases-when-calculating-schema-compatibility
branch
from
December 11, 2023 13:27
b041bf6
to
8b87015
Compare
martin-g
requested changes
Dec 11, 2023
…hema compatibilities
marcosschroh
force-pushed
the
fix/check-aliases-when-calculating-schema-compatibility
branch
from
December 11, 2023 14:48
8b87015
to
fc8a269
Compare
@martin-g I am seeing that the CI is failing because some packages can not be installed as they |
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
martin-g
approved these changes
Dec 12, 2023
martin-g
changed the title
AVRO-3917: [Rust] take field aliases into account when calculating sc…
AVRO-3917: [Rust] take field aliases into account when calculating schema compatibilities
Dec 12, 2023
martin-g
pushed a commit
that referenced
this pull request
Dec 12, 2023
…hema compatibilities (#2633) * AVRO-3917: [Rust] take field aliases into account when calculating schema compatibilities * AVRO-3917: Minor improvements Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> --------- Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> Co-authored-by: Martin Tzvetanov Grigorov <[email protected]> (cherry picked from commit e248e6b)
Thank you, @marcosschroh ! |
woile
reviewed
Dec 13, 2023
// Check whether any of the possible fields names are in the writer schema. | ||
// If the field was found, then it must have the exact same name with the writer field, | ||
// otherwise we would have a false positive with the writers aliases | ||
let mut position = None; |
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.
you can avoid this let mut
with a find:
let position = fields_names.iter().find_map(|field_name| {
if let Some(pos) = w_lookup.get(field_name) {
if &w_fields[*pos].name == field_name {
return Some(pos);
}
}
return None
})
marcosschroh
deleted the
fix/check-aliases-when-calculating-schema-compatibility
branch
February 16, 2024 16:19
RanbirK
pushed a commit
to RanbirK/avro
that referenced
this pull request
May 13, 2024
…hema compatibilities (apache#2633) * AVRO-3917: [Rust] take field aliases into account when calculating schema compatibilities * AVRO-3917: Minor improvements Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> --------- Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> Co-authored-by: Martin Tzvetanov Grigorov <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Verifying this change
This change is partially covered by existing tests, such as
avro_3894_take_aliases_into_account_when_serializing_for_schema_compatibility
, however it does not cover all thealiases
use cases in a proper way. With the changes that I am adding then it will fix the issue and we will covered the missing uses cases. The new test added is take_aliases_into_account_for_schema_compatibilityDocumentation