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: add convert_to_delta #1686

Merged
merged 1 commit into from
Nov 12, 2023
Merged

Conversation

junjunjd
Copy link
Contributor

@junjunjd junjunjd commented Oct 1, 2023

Description

Add a convert_to_delta operation for converting a Parquet table to a Delta Table in place.

Related Issue(s)

Documentation

@github-actions github-actions bot added binding/rust Issues for the Rust crate rust labels Oct 1, 2023
@github-actions
Copy link

github-actions bot commented Oct 1, 2023

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.

Copy link
Member

@rtyler rtyler left a comment

Choose a reason for hiding this comment

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

Thanks for the pull request! This is a great start and I've left some comments. I can help bring this further if you need it, but also feel free to ping me on Slack if you need any further help preparing this for merge!

rust/src/table/convert_to_delta.rs Outdated Show resolved Hide resolved
rust/src/table/convert_to_delta.rs Outdated Show resolved Hide resolved
rust/src/table/convert_to_delta.rs Outdated Show resolved Hide resolved
@rtyler rtyler added this to the Rust v0.17 milestone Oct 2, 2023
@rtyler rtyler marked this pull request as draft October 2, 2023 16:57
@github-actions github-actions bot added the binding/python Issues for the Python package label Oct 7, 2023
@github-actions github-actions bot removed the binding/python Issues for the Python package label Oct 7, 2023
@MrPowers
Copy link
Collaborator

@junjunjd - did you see the comments from @rtyler? Anything else we can do to help you with this one?

@junjunjd
Copy link
Contributor Author

junjunjd commented Oct 13, 2023

@junjunjd junjunjd force-pushed the feat/add-convert-to-delta branch 2 times, most recently from 5a3f56e to 99dbd50 Compare October 13, 2023 07:23
@junjunjd junjunjd force-pushed the feat/add-convert-to-delta branch 2 times, most recently from 80d113f to 09dc423 Compare October 14, 2023 08:31
@junjunjd
Copy link
Contributor Author

junjunjd commented Oct 14, 2023

Follow-up issue #1718 is done. The API now takes a vector of user-defined SchemaField for partition columns.

pub async fn convert_to_delta(
    storage: ObjectStoreRef,
    partition_schema: Vec<SchemaField>,
) -> Result<DeltaTable, Error> 

The changes are pushed to this MR.

@junjunjd junjunjd requested a review from rtyler October 14, 2023 08:52
@junjunjd
Copy link
Contributor Author

@rtyler @wjones127 @roeap This MR is ready for final review.

@junjunjd
Copy link
Contributor Author

@rtyler @wjones127 @roeap Is there anything I can do to help get this merged?

@junjunjd
Copy link
Contributor Author

@rtyler @wjones127 @roeap Just a gentle ping for review.

Copy link
Collaborator

@roeap roeap left a comment

Choose a reason for hiding this comment

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

Thanks for this great wortk @junjunjd! Left some comments in the code.

More generally speaking, I believe we should model CONVET TO DELTA as an operation (i.e. config builder / IntoFuture Trait ...) and also place it in the operations module rather then next to the table. We are slowly but surely working towards also modelling things as logical plans and exposing sql APIs so convert to delta should be compatible whith the other operations we expose.

rust/src/table/convert_to_delta.rs Outdated Show resolved Hide resolved
rust/src/table/convert_to_delta.rs Outdated Show resolved Hide resolved
rust/src/table/convert_to_delta.rs Outdated Show resolved Hide resolved
rust/src/table/convert_to_delta.rs Outdated Show resolved Hide resolved
rust/src/table/convert_to_delta.rs Outdated Show resolved Hide resolved
rust/src/lib.rs Outdated Show resolved Hide resolved
@github-actions github-actions bot removed rust binding/rust Issues for the Rust crate labels Oct 31, 2023
@junjunjd
Copy link
Contributor Author

junjunjd commented Oct 31, 2023

@roeap Thanks for the comments. I updated the MR to model CONVET TO DELTA as an operation. This MR is ready for another review.

@junjunjd junjunjd requested a review from roeap October 31, 2023 08:21
@junjunjd junjunjd force-pushed the feat/add-convert-to-delta branch 2 times, most recently from 4265e4f to eb4ae67 Compare November 1, 2023 03:51
Copy link
Collaborator

@roeap roeap left a comment

Choose a reason for hiding this comment

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

Great work @junjunjd and thanks for sticking with it.

Just some minor nits to look at, but overall I think we are good to go!

crates/deltalake-core/src/operations/convert_to_delta.rs Outdated Show resolved Hide resolved
crates/deltalake-core/src/operations/convert_to_delta.rs Outdated Show resolved Hide resolved
crates/deltalake-core/src/operations/mod.rs Outdated Show resolved Hide resolved
@roeap
Copy link
Collaborator

roeap commented Nov 10, 2023

It seems we do have some compiler errors going on. I would disregard the ones related to a future not being Send at first until the other issues are fixed, they may just resolve themselves :).

@github-actions github-actions bot added binding/rust Issues for the Rust crate crate/core labels Nov 11, 2023
Add a convert_to_delta operation for converting a Parquet table to a Delta
Table in place.
@junjunjd
Copy link
Contributor Author

@roeap Thanks for the review! CI is fixed. MR is ready for final review/merge.

Copy link
Collaborator

@roeap roeap left a comment

Choose a reason for hiding this comment

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

Looking great @junjunjd, thanks for sticking with it!

@roeap roeap merged commit 1368a78 into delta-io:main Nov 12, 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.

CONVERT TO DELTA as a pure delta-rs API Add convertToDelta command
4 participants