nsivabalan commented on code in PR #5788:
URL: https://github.com/apache/hudi/pull/5788#discussion_r893977773


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -116,8 +117,14 @@
   public HoodieMergeHandle(HoodieWriteConfig config, String instantTime, 
HoodieTable<T, I, K, O> hoodieTable,
                            Iterator<HoodieRecord<T>> recordItr, String 
partitionPath, String fileId,
                            TaskContextSupplier taskContextSupplier, 
Option<BaseKeyGenerator> keyGeneratorOpt) {
-    this(config, instantTime, hoodieTable, recordItr, partitionPath, fileId, 
taskContextSupplier,
-        hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, 
fileId).get(), keyGeneratorOpt);
+    super(config, instantTime, partitionPath, fileId, hoodieTable, 
taskContextSupplier);
+    Option<HoodieBaseFile> baseFileOp = 
hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId);
+    if (!baseFileOp.isPresent()) {
+      throw new NoSuchElementException(String.format("FileID %s of 
partitionPath %s is not exist, But record loc is 'U' ", fileId, partitionPath));
+    }
+    init(fileId, recordItr);

Review Comment:
   can we move line 125 to 127 to a private method and call from within both 
the constructors. 



-- 
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]

Reply via email to