Skip to content

fix(table): Handle nullable struct with Required Field#408

Merged
zeroshade merged 7 commits intoapache:mainfrom
zeroshade:nullable-required-field
Apr 30, 2025
Merged

fix(table): Handle nullable struct with Required Field#408
zeroshade merged 7 commits intoapache:mainfrom
zeroshade:nullable-required-field

Conversation

@zeroshade
Copy link
Copy Markdown
Member

fixes #398

Have toRequestedSchema use the new NewStructArrayWithFieldsAndNulls function to correctly propagate null info and handle required fields within a nullable struct.

@zeroshade
Copy link
Copy Markdown
Member Author

@EthanBlackburn please take a look and try this out when you get a chance. Thanks!

@zeroshade zeroshade force-pushed the nullable-required-field branch from fe32e79 to 1316426 Compare April 28, 2025 17:19
@zeroshade zeroshade requested review from Fokko and kevinjqliu April 28, 2025 18:18
@EthanBlackburn
Copy link
Copy Markdown

@zeroshade it works! 🥳

}
}

func ArrowSchemaToIcebergWithoutIDs(sc *arrow.Schema, downcastNsTimestamp bool) (*iceberg.Schema, error) {
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 this name is confusing since we add fresh-IDs?

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.

What about:

Suggested change
func ArrowSchemaToIcebergWithoutIDs(sc *arrow.Schema, downcastNsTimestamp bool) (*iceberg.Schema, error) {
func ArrowSchemaToIcebergWithFreshIDs(sc *arrow.Schema, downcastNsTimestamp bool) (*iceberg.Schema, error) {

Open for other suggestions

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.

What about moving this to testing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

talked with Fokko separately and we decided we'll keep this in for now (albeit renamed). and remove/rework it in the future if necessary.

@zeroshade zeroshade merged commit 8b0c895 into apache:main Apr 30, 2025
7 checks passed
@zeroshade zeroshade deleted the nullable-required-field branch April 30, 2025 17:29
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.

Panic writing nullable struct with required fields

4 participants