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


##########
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:
   How? Previously we would create an empty file and then overwrite it when 
there was data to write so now we "Avoid creating empty files when there is 
content to write."



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