xuzifu666 commented on PR #9960:
URL: https://github.com/apache/hudi/pull/9960#issuecomment-1786715463

   `    // Recursively delete table directories
       if (purge) {
         logInfo("Clean up " + basePath)
         val targetPath = new Path(basePath)
         val engineContext = new 
HoodieSparkEngineContext(sparkSession.sparkContext)
         val fs = FSUtils.getFs(basePath, 
sparkSession.sparkContext.hadoopConfiguration)
         FSUtils.deleteDir(engineContext, fs, targetPath, 
sparkSession.sparkContext.defaultParallelism)
       }`
   but :
   `public static boolean deleteDir(
         HoodieEngineContext hoodieEngineContext, FileSystem fs, Path dirPath, 
int parallelism) {
       try {
         if (fs.exists(dirPath)) {
           FSUtils.parallelizeSubPathProcess(hoodieEngineContext, fs, dirPath, 
parallelism, e -> true,
               pairOfSubPathAndConf -> deleteSubPath(
                   pairOfSubPathAndConf.getKey(), 
pairOfSubPathAndConf.getValue(), true)
           );
           boolean result = fs.delete(dirPath, false);
           LOG.info("Removed directory at " + dirPath);
           return result;
         }
       } catch (IOException ioe) {
         throw new HoodieIOException(ioe.getMessage(), ioe);
       }
       return false;
     }`
   
   boolean result = fs.delete(dirPath, false);  this cause dir cannot be delete


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