nsivabalan commented on code in PR #12105:
URL: https://github.com/apache/hudi/pull/12105#discussion_r1810808499
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -845,13 +844,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:
root issue is, within DirectoryInfo, we have a logic to deduce hoodie
partitions by checking the presence of "_hoodie_partition_meta" file. This
would work only when we do FS based listing. But for MDT based listing, we
already have exact list of files for each partition. So, we do not need to
deduce it. And infact the deduction logic results in no files returned from
DirectoryInfo before this fix.
--
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]