the-other-tim-brown commented on code in PR #9367:
URL: https://github.com/apache/hudi/pull/9367#discussion_r1284923366
##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieBaseFile.java:
##########
@@ -61,16 +62,39 @@ public HoodieBaseFile(String filePath) {
public HoodieBaseFile(String filePath, BaseFile bootstrapBaseFile) {
super(filePath);
this.bootstrapBaseFile = Option.ofNullable(bootstrapBaseFile);
- String[] fileIdAndCommitTime = getFileIdAndCommitTimeFromFileName();
+ String[] fileIdAndCommitTime =
getFileIdAndCommitTimeFromFileName(getFileName());
this.fileId = fileIdAndCommitTime[0];
this.commitTime = fileIdAndCommitTime[1];
}
+ public HoodieBaseFile(String filePath, String fileId, String commitTime,
BaseFile bootstrapBaseFile) {
+ super(filePath);
+ this.bootstrapBaseFile = Option.ofNullable(bootstrapBaseFile);
+ this.fileId = fileId;
+ this.commitTime = commitTime;
+ }
+
+ private HoodieBaseFile(FileStatus fileStatus, String[] fileIdAndCommitTime,
BaseFile bootstrapBaseFile) {
+ this(fileStatus, fileIdAndCommitTime[0], fileIdAndCommitTime[1],
bootstrapBaseFile);
+ }
+
+ public HoodieBaseFile(FileStatus fileStatus, String fileId, String
commitTime, BaseFile bootstrapBaseFile) {
+ super(handleExternallyGeneratedFileName(fileStatus, fileId));
Review Comment:
No, you can see the usages in the PR are by other constructors and the DTO
class. That means that a lot of paths will hit this code.
We currently don't have any validations on file paths, just assumptions.
Should we start adding that now? It should go in a separate patch if so.
--
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]