Skip to content

Core: Support IncrementalChangelogScan with deletes. #6182

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

Closed
wants to merge 2 commits into from

Conversation

Reo-LEI
Copy link
Contributor

@Reo-LEI Reo-LEI commented Nov 14, 2022

This PR is trying to support IncrementalChangelogScan with deletes after #5382

Any feedback is welcome!
cc @rdblue @aokolnychyi @flyrain @stevenzwu @kbendick @chenjunjiedada

@github-actions github-actions bot added the core label Nov 14, 2022
@aokolnychyi
Copy link
Contributor

I had a local PoC for this which was blocked by some changes around sequence numbers. I'll try to find some time to review this PR later this week.

@nastra
Copy link
Contributor

nastra commented Dec 20, 2022

@Reo-LEI @aokolnychyi any updates on this one? Would be great to get this in

@nastra nastra requested a review from aokolnychyi March 6, 2023 07:27
@aokolnychyi
Copy link
Contributor

aokolnychyi commented Mar 6, 2023

Sorry for the delay on this one. I will get to it as soon as I can. I wanted to make sure we wrap v1 table support.

Copy link
Contributor

@alexjo2144 alexjo2144 left a comment

Choose a reason for hiding this comment

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

Just a couple questions for my understanding:

Comment on lines +74 to +75
containAddedDeleteFiles = containAddedDeleteFiles || !info.addedDeleteFiles().isEmpty();
containRemovedDataFiles = containRemovedDataFiles || info.hasRemovedDataFiles();
Copy link
Contributor

Choose a reason for hiding this comment

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

You could short-circuit this loop if both are true. Only matters if the set of snapshot infos may be large though.

Comment on lines -81 to -82
.filterManifestEntries(entry -> changelogSnapshotIds.contains(entry.snapshotId()))
.ignoreExisting();
Copy link
Contributor

Choose a reason for hiding this comment

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

Were these two lines redundant, or are they no longer needed for another reason?

Set<ManifestFile> deleteManifests;
if (containAddedDeleteFiles) {
// scan all dataFiles to locate the deleted record and ensure that this record has not been deleted before
dataManifests = Sets.newHashSet(changelogSnapshots.getLast().dataManifests(tableOps().io()));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can you get away with just the last snapshot in the queue here, but in the other branch you have to iterator over all of them?

context.specAsString(),
context.residuals());
} else {
// ignore removed data files.
Copy link
Contributor

Choose a reason for hiding this comment

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

This case where the commit snapshot id doesn't exist in snapshotOrdinals didn't seem to be possible before, what changed?

@manuzhang
Copy link
Collaborator

@Reo-LEI and @aokolnychyi, are you still working on this?

@Reo-LEI
Copy link
Contributor Author

Reo-LEI commented Feb 20, 2024

@Reo-LEI and @aokolnychyi, are you still working on this?

Sorry for the late reply. I haven't been doing this recently. You can continue to push forward. @manuzhang

@manuzhang
Copy link
Collaborator

I just submitted #9888

Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Aug 24, 2024
Copy link

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions bot closed this Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants