yihua commented on code in PR #12105:
URL: https://github.com/apache/hudi/pull/12105#discussion_r1815520970
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -862,13 +861,14 @@ private List<DirectoryInfo>
listAllPartitionsFromFilesystem(String initializatio
* @param pendingDataInstants Files coming from pending instants are
neglected
* @return List consisting of {@code DirectoryInfo} for each partition found.
*/
- private List<DirectoryInfo> listAllPartitionsFromMDT(String
initializationTime, Set<String> pendingDataInstants) throws IOException {
+ private List<DirectoryInfo> listAllPartitionsFromMDT(StoragePath basePath,
String initializationTime, Set<String> pendingDataInstants) throws IOException {
List<String> allPartitionPaths = metadata.getAllPartitionPaths().stream()
.map(partitionPath -> dataWriteConfig.getBasePath() +
StoragePath.SEPARATOR_CHAR + partitionPath).collect(Collectors.toList());
Map<String, List<StoragePathInfo>> partitionFileMap =
metadata.getAllFilesInPartitions(allPartitionPaths);
List<DirectoryInfo> dirinfoList = new ArrayList<>(partitionFileMap.size());
for (Map.Entry<String, List<StoragePathInfo>> entry :
partitionFileMap.entrySet()) {
- dirinfoList.add(new DirectoryInfo(entry.getKey(), entry.getValue(),
initializationTime, pendingDataInstants));
+ String relativeDirPath = FSUtils.getRelativePartitionPath(basePath, new
StoragePath(entry.getKey()));
Review Comment:
Rename `allPartitionPaths` to `allAbsolutePartitionPaths`
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -862,13 +861,14 @@ private List<DirectoryInfo>
listAllPartitionsFromFilesystem(String initializatio
* @param pendingDataInstants Files coming from pending instants are
neglected
* @return List consisting of {@code DirectoryInfo} for each partition found.
*/
- private List<DirectoryInfo> listAllPartitionsFromMDT(String
initializationTime, Set<String> pendingDataInstants) throws IOException {
+ private List<DirectoryInfo> listAllPartitionsFromMDT(StoragePath basePath,
String initializationTime, Set<String> pendingDataInstants) throws IOException {
List<String> allPartitionPaths = metadata.getAllPartitionPaths().stream()
.map(partitionPath -> dataWriteConfig.getBasePath() +
StoragePath.SEPARATOR_CHAR + partitionPath).collect(Collectors.toList());
Map<String, List<StoragePathInfo>> partitionFileMap =
metadata.getAllFilesInPartitions(allPartitionPaths);
List<DirectoryInfo> dirinfoList = new ArrayList<>(partitionFileMap.size());
for (Map.Entry<String, List<StoragePathInfo>> entry :
partitionFileMap.entrySet()) {
- dirinfoList.add(new DirectoryInfo(entry.getKey(), entry.getValue(),
initializationTime, pendingDataInstants));
+ String relativeDirPath = FSUtils.getRelativePartitionPath(basePath, new
StoragePath(entry.getKey()));
Review Comment:
Get rid of passed-in basePath.
```suggestion
String relativeDirPath =
FSUtils.getRelativePartitionPath(dataWriteConfig.getBasePath(), new
StoragePath(entry.getKey()));
```
--
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]