pabloem commented on a change in pull request #13558:
URL: https://github.com/apache/beam/pull/13558#discussion_r577216075
##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileSystems.java
##########
@@ -401,12 +412,23 @@ public ResourceId apply(@Nonnull Metadata input) {
List<ResourceId> srcToHandle = new ArrayList<>();
List<ResourceId> destToHandle = new ArrayList<>();
- List<MatchResult> matchResults = matchResources(srcResourceIds);
- for (int i = 0; i < matchResults.size(); ++i) {
- if (!matchResults.get(i).status().equals(Status.NOT_FOUND)) {
- srcToHandle.add(srcResourceIds.get(i));
- destToHandle.add(destResourceIds.get(i));
+ List<MatchResult> matchSrcResults = matchResources(srcResourceIds);
+ List<MatchResult> matchDestResults = matchResources(destResourceIds);
+
+ for (int i = 0; i < matchSrcResults.size(); ++i) {
+ if (matchSrcResults.get(i).status().equals(Status.NOT_FOUND) &&
ignoreMissingSrc) {
+ // If the source is not found, and we are ignoring found source files,
then we skip it.
+ continue;
+ }
+ if (matchDestResults.get(i).status().equals(Status.OK)
+ && matchDestResults.get(i).metadata().get(0).sizeBytes()
+ == matchSrcResults.get(i).metadata().get(0).sizeBytes()
+ && skipExistingDest) {
Review comment:
I have added this for GCS in the latest commit, but defaulting to size
for other filesystems. LMK what you think.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]