This commit is contained in:
pengzhuang@cestc.cn 2025-04-10 16:22:15 +08:00 committed by GitHub
commit 9d5c3d012a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -317,7 +317,9 @@ public class HdfsWriter extends Writer {
}else if("/".equals(userPath)){
tmpFilePath = String.format("%s__%s%s", userPath, tmpSuffix, IOUtils.DIR_SEPARATOR);
}else{
tmpFilePath = String.format("%s__%s%s", userPath.substring(0,userPath.length()-1), tmpSuffix, IOUtils.DIR_SEPARATOR);
// tmpFilePath = String.format("%s__%s%s", userPath.substring(0,userPath.length()-1), tmpSuffix, IOUtils.DIR_SEPARATOR);
// 适配window系统目录拼接
tmpFilePath = String.format("%s__%s%s", userPath, tmpSuffix, IOUtils.DIR_SEPARATOR_UNIX);
}
while(hdfsHelper.isPathexists(tmpFilePath)){
tmpSuffix = UUID.randomUUID().toString().replace('-', '_');
@ -326,7 +328,9 @@ public class HdfsWriter extends Writer {
}else if("/".equals(userPath)){
tmpFilePath = String.format("%s__%s%s", userPath, tmpSuffix, IOUtils.DIR_SEPARATOR);
}else{
tmpFilePath = String.format("%s__%s%s", userPath.substring(0,userPath.length()-1), tmpSuffix, IOUtils.DIR_SEPARATOR);
// tmpFilePath = String.format("%s__%s%s", userPath.substring(0,userPath.length()-1), tmpSuffix, IOUtils.DIR_SEPARATOR);
// 适配window系统目录拼接
tmpFilePath = String.format("%s__%s%s", userPath, tmpSuffix, IOUtils.DIR_SEPARATOR_UNIX);
}
}
return tmpFilePath;