HDDS-15174. Add tests for Ozone Iceberg statistics file copy plan.#10189
Open
slfan1989 wants to merge 2 commits intoapache:masterfrom
Open
HDDS-15174. Add tests for Ozone Iceberg statistics file copy plan.#10189slfan1989 wants to merge 2 commits intoapache:masterfrom
slfan1989 wants to merge 2 commits intoapache:masterfrom
Conversation
Contributor
sreejasahithi
left a comment
There was a problem hiding this comment.
Thanks @slfan1989 for adding tests for statistics file copy plan. left a minor comment below.
Comment on lines
+202
to
+211
| @Test | ||
| void statsFileCopyPlanRejectsMismatchedStatsCount() { | ||
| IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, | ||
| () -> RewriteTablePathOzoneUtils.statsFileCopyPlan( | ||
| List.of(statisticsFile("before-1.puffin", 100)), | ||
| List.of())); | ||
|
|
||
| assertEquals("Before and after path rewrite, statistic files count should be same", | ||
| exception.getMessage()); | ||
| } |
Contributor
There was a problem hiding this comment.
statistics files always have the .stats extension in real usage and .puffin is the extension used for Deletion Vector files (*-deletes.puffin). While the test works with any string since statsFileCopyPlan never validates the extension, using .puffin is misleading. Should be .stats
Contributor
Author
There was a problem hiding this comment.
Thanks for the review! Fixed. The test data now uses .stats for statistics files, which better matches the real file naming and avoids implying deletion vector files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR adds unit test coverage for the Ozone Iceberg statistics file copy plan helper.
RewriteTablePathOzoneUtils.statsFileCopyPlanis used by the Ozone IcebergRewriteTablePathimplementation to build copy plan entries for table statistics files. The helper validates that the original and rewritten statistics file lists match in count and file size, and then creates mappings from the original statistics file paths to the rewritten statistics file paths.This PR adds tests for the following cases:
The change improves coverage for the Iceberg rewrite path utility without changing production behavior.
What is the link to the Apache JIRA
HDDS-15174. Add tests for Ozone Iceberg statistics file copy plan.
How was this patch tested?