Skip to content
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

feat: cast list items to default before write with different item names #1959

Merged

Conversation

JonasDev1
Copy link
Contributor

Description

Delta-rs always uses item as the list item name when writing lists. If you read data which is for example written by Spark, the item name is element, in the current implemantation it's not possible to write RecordBatches with a different item name. This leads for example to the problem that you cann't optimize tables which are written by Spark and contain a List column.
In this MR I add condition which will intiate a cast if the list item name of the record batch is different to the target schema one.
I have also tried to explain this behaviour in the tests, but unfortunately creating the test data has become complicated (Happy to get feedback)

This is my first MR in this project

Related Issue(s)

https://github.com/delta-io/delta-rs/blob/main/crates/deltalake-core/src/kernel/arrow/mod.rs#L58
https://github.com/delta-io/delta-rs/pull/684/files#r940790524
https://delta-users.slack.com/archives/C013LCAEB98/p1701885637615699

@github-actions github-actions bot added binding/rust Issues for the Rust crate crate/core labels Dec 12, 2023
Copy link

ACTION NEEDED

delta-rs follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

@JonasDev1 JonasDev1 changed the title Cast list items to default before write with different item names feat: cast list items to default before write with different item names Dec 12, 2023
@ion-elgreco ion-elgreco enabled auto-merge (squash) December 20, 2023 14:26
@ion-elgreco ion-elgreco merged commit bc9253c into delta-io:main Dec 20, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/rust Issues for the Rust crate crate/core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants