-
Notifications
You must be signed in to change notification settings - Fork 155
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
TableMetadataBuilder #587
Open
c-thiel
wants to merge
12
commits into
apache:main
Choose a base branch
from
c-thiel:ft/table-metadata-builder
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,270
−113
Open
TableMetadataBuilder #587
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
dfd81bc
Squash builder
c-thiel acbbbdf
Address comments
c-thiel 47270f7
Address comments
c-thiel 6a55d6f
Match on FormatVersion to fail for V3
c-thiel 164e90c
Fix examples
c-thiel 64ab410
Merge branch 'main' into ft/table-metadata-builder
c-thiel 9929a82
Fix tests
c-thiel 937ea7a
Address comments
c-thiel 826fb08
Address comments
c-thiel e733c30
Update crates/iceberg/src/spec/table_metadata_builder.rs
c-thiel 941cc4d
Remove ReferenceType
c-thiel 53e30e0
Fix import
c-thiel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,6 @@ impl SchemaBuilder { | |
/// Reassignment starts from the field-id specified in `start_from` (inclusive). | ||
/// | ||
/// All specified aliases and identifier fields will be updated to the new field-ids. | ||
#[allow(dead_code)] // Will be needed in TableMetadataBuilder | ||
pub(crate) fn with_reassigned_field_ids(mut self, start_from: u32) -> Self { | ||
self.reassign_field_ids_from = Some(start_from.try_into().unwrap_or(i32::MAX)); | ||
self | ||
|
@@ -376,6 +375,24 @@ impl Schema { | |
pub fn accessor_by_field_id(&self, field_id: i32) -> Option<Arc<StructAccessor>> { | ||
self.field_id_to_accessor.get(&field_id).cloned() | ||
} | ||
|
||
/// Check if this schema is identical to another schema semantically - excluding schema id. | ||
pub(crate) fn is_same_schema(&self, other: &SchemaRef) -> bool { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not implement |
||
self.as_struct().eq(other.as_struct()) | ||
&& self.identifier_field_ids().eq(other.identifier_field_ids()) | ||
} | ||
|
||
/// Change the schema id of this schema. | ||
// This is redundant with the `with_schema_id` method on the builder, but useful | ||
// as it is infallible in contrast to the builder `build()` method. | ||
pub(crate) fn with_schema_id(self, schema_id: SchemaId) -> Self { | ||
Self { schema_id, ..self } | ||
} | ||
|
||
/// Return A HashMap matching field ids to field names. | ||
pub(crate) fn field_id_to_name_map(&self) -> &HashMap<i32, String> { | ||
&self.id_to_name | ||
} | ||
} | ||
|
||
impl Display for Schema { | ||
|
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Remove this debug statement?