This is an automated email from the ASF dual-hosted git repository.
vinoyang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new bd9ccec [HUDI-1395] Fix partition path using FSUtils (#2312)
bd9ccec is described below
commit bd9cceccb582ede88b989824241498e8c32d4f13
Author: Raymond Xu <[email protected]>
AuthorDate: Wed Dec 9 18:19:19 2020 -0800
[HUDI-1395] Fix partition path using FSUtils (#2312)
Fixed the logic to get partition path in Copier and Exporter utilities.
---
.../src/main/java/org/apache/hudi/utilities/HoodieSnapshotCopier.java | 4 ++--
.../main/java/org/apache/hudi/utilities/HoodieSnapshotExporter.java | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git
a/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieSnapshotCopier.java
b/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieSnapshotCopier.java
index 05b4627..2826108 100644
---
a/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieSnapshotCopier.java
+++
b/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieSnapshotCopier.java
@@ -111,7 +111,7 @@ public class HoodieSnapshotCopier implements Serializable {
// also need to copy over partition metadata
Path partitionMetaFile =
- new Path(new Path(baseDir, partition),
HoodiePartitionMetadata.HOODIE_PARTITION_METAFILE);
+ new Path(FSUtils.getPartitionPath(baseDir, partition),
HoodiePartitionMetadata.HOODIE_PARTITION_METAFILE);
if (fs1.exists(partitionMetaFile)) {
filePaths.add(new Tuple2<>(partition, partitionMetaFile.toString()));
}
@@ -122,7 +122,7 @@ public class HoodieSnapshotCopier implements Serializable {
context.foreach(filesToCopy, tuple -> {
String partition = tuple._1();
Path sourceFilePath = new Path(tuple._2());
- Path toPartitionPath = new Path(outputDir, partition);
+ Path toPartitionPath = FSUtils.getPartitionPath(outputDir, partition);
FileSystem ifs = FSUtils.getFs(baseDir, serConf.newCopy());
if (!ifs.exists(toPartitionPath)) {
diff --git
a/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieSnapshotExporter.java
b/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieSnapshotExporter.java
index cf69dd2..c69d004 100644
---
a/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieSnapshotExporter.java
+++
b/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieSnapshotExporter.java
@@ -208,7 +208,7 @@ public class HoodieSnapshotExporter {
dataFiles.forEach(hoodieDataFile -> filePaths.add(new
Tuple2<>(partition, hoodieDataFile.getPath())));
// also need to copy over partition metadata
Path partitionMetaFile =
- new Path(new Path(cfg.sourceBasePath, partition),
HoodiePartitionMetadata.HOODIE_PARTITION_METAFILE);
+ new Path(FSUtils.getPartitionPath(cfg.sourceBasePath, partition),
HoodiePartitionMetadata.HOODIE_PARTITION_METAFILE);
FileSystem fs = FSUtils.getFs(cfg.sourceBasePath, serConf.newCopy());
if (fs.exists(partitionMetaFile)) {
filePaths.add(new Tuple2<>(partition, partitionMetaFile.toString()));
@@ -219,7 +219,7 @@ public class HoodieSnapshotExporter {
context.foreach(files, tuple -> {
String partition = tuple._1();
Path sourceFilePath = new Path(tuple._2());
- Path toPartitionPath = new Path(cfg.targetOutputPath, partition);
+ Path toPartitionPath = FSUtils.getPartitionPath(cfg.targetOutputPath,
partition);
FileSystem fs = FSUtils.getFs(cfg.targetOutputPath, serConf.newCopy());
if (!fs.exists(toPartitionPath)) {