1
0

[HUDI-1523] Call mkdir(partition) only if not exists (#2501)

This commit is contained in:
Sivabalan Narayanan
2021-02-03 09:02:37 -05:00
committed by GitHub
parent d74d8e2084
commit eb91e5ba70
3 changed files with 9 additions and 3 deletions

View File

@@ -108,7 +108,9 @@ public abstract class HoodieWriteHandle<T extends HoodieRecordPayload, I, K, O>
public Path makeNewPath(String partitionPath) {
Path path = FSUtils.getPartitionPath(config.getBasePath(), partitionPath);
try {
fs.mkdirs(path); // create a new partition as needed.
if (!fs.exists(path)) {
fs.mkdirs(path); // create a new partition as needed.
}
} catch (IOException e) {
throw new HoodieIOException("Failed to make dir " + path, e);
}

View File

@@ -189,7 +189,9 @@ public class MarkerFiles implements Serializable {
public Path create(String partitionPath, String dataFileName, IOType type) {
Path path = FSUtils.getPartitionPath(markerDirPath, partitionPath);
try {
fs.mkdirs(path); // create a new partition as needed.
if (!fs.exists(path)) {
fs.mkdirs(path); // create a new partition as needed.
}
} catch (IOException e) {
throw new HoodieIOException("Failed to make dir " + path, e);
}

View File

@@ -172,7 +172,9 @@ public class HoodieRowCreateHandle implements Serializable {
private Path makeNewPath(String partitionPath) {
Path path = FSUtils.getPartitionPath(writeConfig.getBasePath(), partitionPath);
try {
fs.mkdirs(path); // create a new partition as needed.
if (!fs.exists(path)) {
fs.mkdirs(path); // create a new partition as needed.
}
} catch (IOException e) {
throw new HoodieIOException("Failed to make dir " + path, e);
}