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.

@junjunjd junjunjd force-pushed the feat/add-convert-to-delta branch from 781ea5b to d2e70f9 Compare October 1, 2023 09:24
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
@junjunjd junjunjd force-pushed the feat/add-convert-to-delta branch from d2e70f9 to b6500d8 Compare October 7, 2023 10:01
@github-actions github-actions bot added the binding/python Issues for the Python package label Oct 7, 2023
@junjunjd junjunjd force-pushed the feat/add-convert-to-delta branch from b6500d8 to df20b56 Compare October 7, 2023 10:03
@github-actions github-actions bot removed the binding/python Issues for the Python package label Oct 7, 2023
@MrPowers
Copy link
Contributor

@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 junjunjd force-pushed the feat/add-convert-to-delta branch from e4cae43 to aa514b0 Compare October 16, 2023 08:26
@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
@junjunjd junjunjd force-pushed the feat/add-convert-to-delta branch from 4e9671e to d655f53 Compare October 31, 2023 07:43
@github-actions github-actions bot removed rust binding/rust Issues for the Rust crate labels Oct 31, 2023
@junjunjd junjunjd force-pushed the feat/add-convert-to-delta branch from d655f53 to a8e9413 Compare October 31, 2023 08:12
@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
@junjunjd junjunjd force-pushed the feat/add-convert-to-delta branch 2 times, most recently from 9bb866f to c32157f Compare November 9, 2023 08:45
@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 :).

@junjunjd junjunjd force-pushed the feat/add-convert-to-delta branch from c32157f to 7f3c1d0 Compare November 11, 2023 23:55
@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 junjunjd force-pushed the feat/add-convert-to-delta branch from 7f3c1d0 to 5b2951a Compare November 12, 2023 00:16
@junjunjd junjunjd requested a review from roeap November 12, 2023 00:16
@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