the-other-tim-brown commented on code in PR #13413:
URL: https://github.com/apache/hudi/pull/13413#discussion_r2136773666


##########
hudi-io/src/main/java/org/apache/hudi/common/util/FileIOUtils.java:
##########
@@ -169,19 +169,12 @@ public static void createFileInPath(HoodieStorage storage,
                                       StoragePath fullPath,
                                       Option<HoodieInstantWriter> 
contentWriter, boolean ignoreIOE) {
     try {
-      // If the path does not exist, create it first
-      if (!storage.exists(fullPath)) {
-        if (storage.createNewFile(fullPath)) {
-          LOG.info("Created a new file in meta path: {}", fullPath);
-        } else {
-          throw new HoodieIOException("Failed to create file " + fullPath);
-        }
-      }
-
       if (contentWriter.isPresent()) {
         try (OutputStream out = storage.create(fullPath, true)) {
           contentWriter.get().writeToStream(out);
         }
+      } else {
+        storage.createNewFile(fullPath);

Review Comment:
   That's correct, there are cases where there is no content to be written and 
the `contentWriter` is an empty option



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