pengzhiwei2018 commented on a change in pull request #3193:
URL: https://github.com/apache/hudi/pull/3193#discussion_r666723325
##########
File path:
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HoodieRealtimeInputFormatUtils.java
##########
@@ -161,28 +162,18 @@
.map(instant ->
fsView.getLatestMergedFileSlicesBeforeOrOn(relPartitionPath,
instant.getTimestamp()))
.orElse(Stream.empty());
- // subgroup splits again by file id & match with log files.
- Map<String, List<HoodieBaseFile>> groupedInputSplits =
partitionsToParquetSplits.get(partitionPath).stream()
- .collect(Collectors.groupingBy(file ->
FSUtils.getFileId(file.getFileStatus().getPath().getName())));
latestFileSlices.forEach(fileSlice -> {
- List<HoodieBaseFile> dataFileSplits =
groupedInputSplits.get(fileSlice.getFileId());
- dataFileSplits.forEach(split -> {
- try {
- List<String> logFilePaths =
fileSlice.getLogFiles().sorted(HoodieLogFile.getLogFileComparator())
+ List<String> logFilePaths =
fileSlice.getLogFiles().sorted(HoodieLogFile.getLogFileComparator())
.map(logFile ->
logFile.getPath().toString()).collect(Collectors.toList());
- resultMap.put(split, logFilePaths);
- } catch (Exception e) {
- throw new HoodieException("Error creating hoodie real time split
", e);
- }
- });
+ baseAndLogsList.add(Pair.of(fileSlice.getBaseFile(), logFilePaths));
Review comment:
No, for log only file slice, the fileSlice.getBaseFile() is an empty
Option.
--
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]