-
Notifications
You must be signed in to change notification settings - Fork 3k
Spark: Improve performance of expire snapshot by not double-scanning retained Snapshots #3457
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
Changes from all commits
f46a17f
aa2630a
b3d37b4
f829649
8d7ea44
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,8 @@ | |
| import java.util.Map; | ||
| import java.util.Set; | ||
| import java.util.UUID; | ||
| import java.util.stream.Collectors; | ||
| import java.util.stream.StreamSupport; | ||
| import org.apache.arrow.vector.ValueVector; | ||
| import org.apache.avro.generic.GenericData; | ||
| import org.apache.avro.generic.GenericData.Record; | ||
|
|
@@ -808,4 +810,11 @@ public static Set<DeleteFile> deleteFiles(Table table) { | |
|
|
||
| return deleteFiles; | ||
| } | ||
|
|
||
| public static Set<String> reachableManifestPaths(Table table) { | ||
| return StreamSupport.stream(table.snapshots().spliterator(), false) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's actually a method in
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if I miss something, but looks like that is for data files of a manifest, while this is for listing manifests?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah it's for listing live data file paths for a given manifest. |
||
| .flatMap(s -> s.allManifests(table.io()).stream()) | ||
| .map(ManifestFile::path) | ||
| .collect(Collectors.toSet()); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test is okay, but I think that it doesn't really test cases where the retained and deleted files are mixed together. That deserves a direct test, where the
deleteCandidateFileDSactually contains files in thevalidFileDS.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, added test below