Skip to content

Commit

Permalink
Fix CopyFileOperator
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Dec 24, 2024
1 parent 9b79d56 commit a8ebd60
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,26 @@
/** The information of copy file. */
public class CloneFileInfo {

private final String sourceFilePath;
private final String filePathExcludeTableRoot;
private final String sourceIdentifier;
private final String targetIdentifier;

public CloneFileInfo(
String filePathExcludeTableRoot, String sourceIdentifier, String targetIdentifier) {
String sourceFilePath,
String filePathExcludeTableRoot,
String sourceIdentifier,
String targetIdentifier) {
this.sourceFilePath = sourceFilePath;
this.filePathExcludeTableRoot = filePathExcludeTableRoot;
this.sourceIdentifier = sourceIdentifier;
this.targetIdentifier = targetIdentifier;
}

public String getSourceFilePath() {
return sourceFilePath;
}

public String getFilePathExcludeTableRoot() {
return filePathExcludeTableRoot;
}
Expand All @@ -47,7 +56,7 @@ public String getTargetIdentifier() {
@Override
public String toString() {
return String.format(
"{ filePath: %s, sourceIdentifier: %s, targetIdentifier: %s }",
filePathExcludeTableRoot, sourceIdentifier, targetIdentifier);
"{ sourceFilePath: %s, filePathExcludeTableRoot: %s, sourceIdentifier: %s, targetIdentifier: %s }",
sourceFilePath, filePathExcludeTableRoot, sourceIdentifier, targetIdentifier);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void processElement(StreamRecord<CloneFileInfo> streamRecord) throws Exce
});

String filePathExcludeTableRoot = cloneFileInfo.getFilePathExcludeTableRoot();
Path sourcePath = new Path(sourceTableRootPath + filePathExcludeTableRoot);
Path sourcePath = new Path(cloneFileInfo.getSourceFilePath());
Path targetPath = new Path(targetTableRootPath + filePathExcludeTableRoot);

if (targetTableFileIO.exists(targetPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ private List<CloneFileInfo> toCloneFileInfos(
for (Path file : files) {
Path relativePath = getPathExcludeTableRoot(file, sourceTableRoot);
result.add(
new CloneFileInfo(relativePath.toString(), sourceIdentifier, targetIdentifier));
new CloneFileInfo(
file.toUri().toString(),
relativePath.toString(),
sourceIdentifier,
targetIdentifier));
}
return result;
}
Expand Down

0 comments on commit a8ebd60

Please sign in to comment.