-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clone]refactor the clone action as we introduced external path #4844
base: master
Are you sure you want to change the base?
Changes from 5 commits
644594d
aeeb30f
31bf4e7
80a034f
0f96789
3e47968
bb5523a
902e659
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,29 +18,35 @@ | |
|
||
package org.apache.paimon.flink.clone; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/** The information of copy file. */ | ||
public class CloneFileInfo { | ||
|
||
private final String sourceFilePath; | ||
private final String filePathExcludeTableRoot; | ||
@Nullable private final String sourceFilePath; | ||
@Nullable private final String filePathExcludeTableRoot; | ||
private final String sourceIdentifier; | ||
private final String targetIdentifier; | ||
private final long snapshotId; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this field, see my comments for operators. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can not remove this filed. because if do not provided the snapshotId. when we do job in CopyManifestFilesOperator, we can not just pick the data files in manifest file, because the data files maybe delete in another mainifest file. for example, in snapshot1, we add one data file So we can not just pick the data files in manifest file. I think we still need the snapshot id. What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we don't need to worry about deleting files in the manifest anymore. We just need to see which data files we need. Although we may copy extra files, it won't cause any problems There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is that, when snapshot1 is expired, then the |
||
|
||
public CloneFileInfo( | ||
String sourceFilePath, | ||
String filePathExcludeTableRoot, | ||
@Nullable String sourceFilePath, | ||
@Nullable String filePathExcludeTableRoot, | ||
String sourceIdentifier, | ||
String targetIdentifier) { | ||
String targetIdentifier, | ||
long snapshotId) { | ||
this.sourceFilePath = sourceFilePath; | ||
this.filePathExcludeTableRoot = filePathExcludeTableRoot; | ||
this.sourceIdentifier = sourceIdentifier; | ||
this.targetIdentifier = targetIdentifier; | ||
this.snapshotId = snapshotId; | ||
} | ||
|
||
@Nullable | ||
public String getSourceFilePath() { | ||
return sourceFilePath; | ||
} | ||
|
||
@Nullable | ||
public String getFilePathExcludeTableRoot() { | ||
return filePathExcludeTableRoot; | ||
} | ||
|
@@ -53,10 +59,19 @@ public String getTargetIdentifier() { | |
return targetIdentifier; | ||
} | ||
|
||
public long getSnapshotId() { | ||
return snapshotId; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.format( | ||
"{ sourceFilePath: %s, filePathExcludeTableRoot: %s, sourceIdentifier: %s, targetIdentifier: %s }", | ||
sourceFilePath, filePathExcludeTableRoot, sourceIdentifier, targetIdentifier); | ||
"{ sourceFilePath: %s, filePathExcludeTableRoot: %s, sourceIdentifier: %s, targetIdentifier: %s, " | ||
+ "snapshotId: %d}", | ||
sourceFilePath, | ||
filePathExcludeTableRoot, | ||
sourceIdentifier, | ||
targetIdentifier, | ||
snapshotId); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where will this variable be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is used to transfer selections between upstream and downstream. For example, when creating the schema file, the latest snapshotid of the snapshot is determined. When selecting the data file later, the snapshot id is used for selection. Because in this process, the latest snapshot may change. If the snapshot id is not passed, the cloned schema file and data file may not be from the same snapshot.