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

allow for optimize without commits, surface commit API to python client for deferred committing #1

Merged
merged 3 commits into from
Mar 8, 2024

Conversation

asura-io
Copy link
Owner

@asura-io asura-io commented Mar 4, 2024

Description

The description of the main changes of your pull request

Related Issue(s)

Documentation

@asura-io asura-io force-pushed the gautham/release-gil branch 21 times, most recently from 7677d64 to cc51d41 Compare March 6, 2024 22:50
@asura-io asura-io changed the title Optimize commit v1 allow for optimize without commits, surface commit API to python client for deferred committing Mar 6, 2024

let commit = match &self._commit {
Some(c) => c,
None => panic!("No commit found from previous optimize, cannot commit."),
Copy link

Choose a reason for hiding this comment

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

should throw a python exception instead.

python/src/lib.rs Outdated Show resolved Hide resolved
python/src/lib.rs Outdated Show resolved Hide resolved
python/src/lib.rs Outdated Show resolved Hide resolved
gautham acharya and others added 2 commits March 8, 2024 07:39
@asura-io asura-io force-pushed the gautham/release-gil branch 7 times, most recently from e549858 to f5f70ed Compare March 8, 2024 20:25
self,
commit_info: CommitContext
) -> DeltaResult<DeltaTable> {
let _ = commit(
Copy link

Choose a reason for hiding this comment

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

what's the reason for let _ =?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Updated to use ? and propagate the error


rt()?.block_on(
cmd.commit_writes(
self._commit.take().unwrap()
Copy link
Owner Author

Choose a reason for hiding this comment

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

@houqp is this the best way to handle this case? .take().unwrap()?

Some(CommitContext{
actions: total_actions,
app_metadata,
snapshot: Some(snapshot.clone()), // using original table snapshot as all commits are added at once
Copy link
Owner Author

Choose a reason for hiding this comment

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

Not 100% sure if this is correct -- maybe we need to use table.snapshot() if there were other writes?

self,
commit_info: CommitContext
) -> DeltaResult<DeltaTable> {
let _ = commit(
Copy link
Owner Author

Choose a reason for hiding this comment

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

Updated to use ? and propagate the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants