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

[Spark] Metadata Cleanup for Unbackfilled Delta Files #3094

Merged
merged 1 commit into from
May 22, 2024

Conversation

sumeet-db
Copy link
Collaborator

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • Kernel
  • Other (fill in here)

Description

Unbackfilled deltas eligible for deletion:

  • Version <= max(backfilled-delta-deleted-versions)

How was this patch tested?

Unit tests

Does this PR introduce any user-facing changes?

No

@sumeet-db sumeet-db force-pushed the metadata_normal branch 4 times, most recently from 51c4853 to 619cd42 Compare May 20, 2024 05:57
Copy link
Contributor

@LukasRupprecht LukasRupprecht left a comment

Choose a reason for hiding this comment

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

LGTM (left one clarifying comment).

expiredDeltaLogs.map(_.getPath).foreach { path =>
// recursive = false
if (fs.delete(path, false)) {
numDeleted += 1
if (FileNames.isCheckpointFile(path)) {
wasCheckpointDeleted = true
}
if (FileNames.isDeltaFile(path)) {
maxBackfilledVersionDeleted =
Math.max(maxBackfilledVersionDeleted, FileNames.deltaVersion(path))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need the max here? Shouldn't files be deleted in order?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ideally yes. But we're being defensive here.

@allisonport-db allisonport-db merged commit 529717b into delta-io:master May 22, 2024
9 of 10 checks passed
longvu-db pushed a commit to longvu-db/delta that referenced this pull request May 28, 2024
#### Which Delta project/connector is this regarding?

- [x] Spark
- [ ] Standalone
- [ ] Flink
- [ ] Kernel
- [ ] Other (fill in here)

## Description

Unbackfilled deltas eligible for deletion:
- Version <= max(backfilled-delta-deleted-versions)

## How was this patch tested?

Unit tests

## Does this PR introduce _any_ user-facing changes?

No
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.

None yet

3 participants