Skip to content

Commit 36e0b07

Browse files
committed
include file slice after a pending compaction for spark reader
1 parent 00848b6 commit 36e0b07

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

hudi-flink/src/test/java/org/apache/hudi/table/format/TestInputFormat.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ void testReadWithWiderSchema(HoodieTableType tableType) throws Exception {
462462
List<RowData> result = readData(inputFormat);
463463
TestData.assertRowDataEquals(result, TestData.DATA_SET_INSERT);
464464
}
465+
465466
/**
466467
* Test reading file groups with compaction plan scheduled and delta logs.
467468
* File-slice after pending compaction-requested instant-time should also be considered valid.

hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HoodieRealtimeInputFormatUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public static List<Pair<Option<HoodieBaseFile>, List<String>>> groupLogsByBaseFi
237237
try {
238238
// Both commit and delta-commits are included - pick the latest completed one
239239
Option<HoodieInstant> latestCompletedInstant =
240-
metaClient.getActiveTimeline().getCommitsTimeline().filterCompletedInstants().lastInstant();
240+
metaClient.getCommitsAndCompactionTimeline().filterCompletedAndCompactionInstants().lastInstant();
241241

242242
Stream<FileSlice> latestFileSlices = latestCompletedInstant
243243
.map(instant -> fsView.getLatestMergedFileSlicesBeforeOrOn(relPartitionPath, instant.getTimestamp()))

0 commit comments

Comments
 (0)