Uh oh!
There was an error while loading. Please reload this page.
Spark: Ensure that partition stats files are considered for GC procedures - #9284
Conversation
| * @return the location of statistics files | ||
| * @deprecated use the {@code statisticsFilesLocationsForSnapshots(table, snapshotIds)} instead. | ||
| */ | ||
| @Deprecated |
There was a problem hiding this comment.
can't use the Predicate<StatisticsFile> for partition stats. Hence, deprecated and introduced snapshot id based input like other methods in this class (manifest list, manifest etc)
| Assertions.assertThat(output.get(0)[5]).as("should be 1 deleted statistics file").isEqualTo(1L); | ||
| table.refresh(); | ||
| List<StatisticsFile> statsWithSnapshotId1 = |
There was a problem hiding this comment.
Since we are checking containsExactly at line 482, no need of these checks.
bf5a896 to
d3e75e0Compare| * @param table table for which statistics files needs to be listed | ||
| * @param predicate predicate for filtering the statistics files | ||
| * @return the location of statistics files | ||
| * @deprecated use the {@code statisticsFilesLocationsForSnapshots(table, snapshotIds)} instead. |
There was a problem hiding this comment.
Shall we add a note on when it was deprecated (1.5.0) and when it will be removed (1.6.0)?
There was a problem hiding this comment.
I have added this already in previous commit.
| * statistics files for all the snapshots will be returned. | ||
| * @return the location of statistics files | ||
| */ | ||
| public static List<String> statisticsFilesLocationsForSnapshots( |
There was a problem hiding this comment.
What do you think about calling it statisticsFilesLocations to match manifestListLocations that also accepts a set of snapshot IDs?
There was a problem hiding this comment.
The deprecated method already has a name statisticsFilesLocations. So, If I keep the same name, compiler says ambiguous error when I call statisticsFilesLocationsForSnapshots(table, null)
Hence, I had to keep different name.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
aokolnychyi
commented
Dec 20, 2023
@ajantha-bhat, this looks mostly good to me. Can we add the tests to all Spark versions to be safe? |
ajantha-bhat
commented
Dec 20, 2023
Sure. I didn't initially add to other spark version thinking if I get any comments for test, I have to rework in all the spark version. So, I thought of adding tests in a single follow up PR for other spark versions. Now that we don't have any specific comment on test, I can add it in this PR itself. |
ajantha-bhat
commented
Dec 20, 2023
@aokolnychyi: Thanks for the review. Build passed and PR is ready. |
ajantha-bhat
commented
Jan 3, 2024
ping @aokolnychyi |
aokolnychyi
left a comment
There was a problem hiding this comment.
It looks good to me, I had one optional comment. Let me know what you want to do there, @ajantha-bhat.
ajantha-bhat
commented
Jan 17, 2024
@aokolnychyi : Are you referring to #9284 (comment) comment? I have replied why I can't change the name due to compile time ambiguity of same signature. |
aokolnychyi
commented
Jan 18, 2024
Oops, I probably forgot to post the comment. I was thinking about |
ajantha-bhat
commented
Jan 18, 2024
The new method |
aokolnychyi
commented
Jan 18, 2024
Yep, that's fair. Let's keep it as is then. |
aokolnychyi
commented
Jan 18, 2024
Thanks, @ajantha-bhat! |
Expire snapshots and remove orphan files action/procedure should also consider partition stats files.
Fixes#9336