ajantha-bhat commented on code in PR #9020:
URL: https://github.com/apache/iceberg/pull/9020#discussion_r1388758670
##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteManifestsSparkAction.java:
##########
@@ -159,34 +169,49 @@ public RewriteManifests.Result execute() {
}
private RewriteManifests.Result doExecute() {
- List<ManifestFile> matchingManifests = findMatchingManifests();
+ List<ManifestFile> rewrittenManifests = Lists.newArrayList();
+ List<ManifestFile> addedManifests = Lists.newArrayList();
+
+ Result dataResult = rewriteManifests(ManifestContent.DATA);
+ Iterables.addAll(rewrittenManifests, dataResult.rewrittenManifests());
+ Iterables.addAll(addedManifests, dataResult.addedManifests());
+
+ Result deletesResult = rewriteManifests(ManifestContent.DELETES);
+ Iterables.addAll(rewrittenManifests, deletesResult.rewrittenManifests());
+ Iterables.addAll(addedManifests, deletesResult.addedManifests());
+
+ if (rewrittenManifests.isEmpty() && addedManifests.isEmpty()) {
Review Comment:
Functionally it is fine. It is checking whether calling `rewriteManifests`
for both data and delete has returned EMPTY_RESULT. If so, method is retuning
empty result.
But is just checking `rewrittenManifests.isEmpty()` is enough (instead of
both)? Because how can there be a added new manifest when rewrittenManifests
are empty?
--
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]