Skip to content

name mapping serde - #740

Merged
Fokko merged 1 commit into
apache:mainfrom
barronw:name-mapping
Dec 10, 2024
Merged

name mapping serde#740
Fokko merged 1 commit into
apache:mainfrom
barronw:name-mapping

Conversation

@barronw

@barronw barronw commented Nov 28, 2024

Copy link
Copy Markdown
Contributor

Closes #723.

#[serde(rename_all = "kebab-case")]
pub struct MappedField {
#[serde(skip_serializing_if = "Option::is_none")]
pub field_id: Option<i32>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fokko I noticed that pyiceberg has this field as required instead of optional (reference), but the spec says that tables may omit this field (reference).

Fields that exist in imported files but not in the Iceberg schema may omit field-id.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I noticed that field-id is optional in Java as well. Created an issue on PyIceberg: apache/iceberg-python#1420

mod datatypes;
mod manifest;
mod manifest_list;
mod name_mapping;

@barronw barronw Nov 28, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let me know if I should also expose the name mapping in TableMetadata and Table (as pyiceberg does).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can add them later on 👍

@Fokko
Fokko self-requested a review December 6, 2024 20:19

@Fokko Fokko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @barronw for working on this, and sorry for the late reply.

@Fokko
Fokko merged commit eb1f31c into apache:main Dec 10, 2024
@barronw
barronw deleted the name-mapping branch December 10, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Able to parse name-mapping into a recusive structure.

2 participants