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

Move writes to Transaction #571

Merged
merged 2 commits into from
Apr 4, 2024
Merged

Move writes to Transaction #571

merged 2 commits into from
Apr 4, 2024

Conversation

sungwy
Copy link
Collaborator

@sungwy sungwy commented Apr 3, 2024

As a followup from @HonahX 's suggestion on #498

This refactoring is required both for supporting CreateTableTransaction, and supporting static overwrites through delete + append

@jqin61 jqin61 mentioned this pull request Apr 3, 2024


@pytest.mark.integration
def test_write_within_transaction(spark: SparkSession, session_catalog: Catalog, arrow_table_with_null: pa.Table) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we cover overwrite in the test as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure thing :)

Copy link
Contributor

@HonahX HonahX left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @syun64 for taking this and @jqin61 for reviewing!

Continue the discussion #498 (comment) here:

I agree that removing them from Table class can simplify the implementation and emphasize the concept of "transaction". It appears that these methods in the Table class serve as handy tools for users to perform simple updates or data insertion. Considering these methods were released in 0.6.0, how about we initiate an issue to gather feedback from our users? This could facilitate a discussion on whether these methods should be deprecated.

@Fokko
Copy link
Contributor

Fokko commented Apr 4, 2024

The methods on the table were added as shorthands indeed. I'm open to removing those methods and letting everything go through a transaction. This way we have a single way to do things, and it also emphasizes that it is a transaction and done in an atomic way.

@Fokko Fokko merged commit d69407c into apache:main Apr 4, 2024
7 checks passed
@Fokko
Copy link
Contributor

Fokko commented Apr 4, 2024

Thanks for working on this @syun64 and @HonahX for the review 🙌

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.

4 participants