yihua commented on code in PR #11445:
URL: https://github.com/apache/hudi/pull/11445#discussion_r1751119822
##########
hudi-hadoop-common/src/main/java/org/apache/hudi/storage/hadoop/HoodieHadoopStorage.java:
##########
@@ -235,12 +236,24 @@ public boolean rename(StoragePath oldPath, StoragePath
newPath) throws IOExcepti
@Override
public boolean deleteDirectory(StoragePath path) throws IOException {
- return fs.delete(convertToHadoopPath(path), true);
+ return delete(path, true);
+
}
@Override
public boolean deleteFile(StoragePath path) throws IOException {
- return fs.delete(convertToHadoopPath(path), false);
+ return delete(path, false);
+ }
+
+ private boolean delete(StoragePath path, boolean recursive) throws
IOException {
+ Path hadoopPath = convertToHadoopPath(path);
+ boolean success = fs.delete(hadoopPath, recursive);
+ if (!success) {
+ if (fs.exists(hadoopPath)) {
+ throw new HoodieIOException("Failed to delete invalid data file: " +
path);
+ }
+ }
+ return success;
Review Comment:
Should this always return true as the deletion is successful after
validation?
--
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]