sreejasahithi commented on code in PR #10189:
URL: https://github.com/apache/ozone/pull/10189#discussion_r3190747548
##########
hadoop-ozone/iceberg/src/test/java/org/apache/hadoop/ozone/iceberg/TestRewriteTablePathOzoneAction.java:
##########
@@ -188,6 +191,51 @@ void tablePathRewriteForStartAndEndVersionProvided()
throws Exception {
assertAllInternalPathsRewritten(csvPairs, targetPrefix);
}
+ @Test
+ void statsFileCopyPlanReturnsEmptySetForEmptyStats() {
+ Set<Pair<String, String>> copyPlan =
+ RewriteTablePathOzoneUtils.statsFileCopyPlan(List.of(), List.of());
+
+ assertTrue(copyPlan.isEmpty());
+ }
+
+ @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());
+ }
Review Comment:
statistics files always have the `.stats` extension in real usage `.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`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]