If there are multiple files under the same partition path and file ID, sort them according to the modification time of the files to avoid reading the files that failed to write before.
This commit is contained in:
@@ -185,7 +185,11 @@ public abstract class AbstractTableFileSystemView implements SyncableFileSystemV
|
||||
String fileId = pair.getValue();
|
||||
HoodieFileGroup group = new HoodieFileGroup(pair.getKey(), fileId, timeline);
|
||||
if (baseFiles.containsKey(pair)) {
|
||||
baseFiles.get(pair).forEach(group::addBaseFile);
|
||||
// if there are multiple files under the same partition path and file ID, sort them according to the
|
||||
// modification time of the files to avoid reading the files that failed to write before.
|
||||
List<HoodieBaseFile> partitionFileIdPairBaseFiles = baseFiles.get(pair);
|
||||
partitionFileIdPairBaseFiles.sort(Comparator.comparingLong(o -> o.getFileStatus().getModificationTime()));
|
||||
partitionFileIdPairBaseFiles.forEach(group::addBaseFile);
|
||||
}
|
||||
if (logFiles.containsKey(pair)) {
|
||||
logFiles.get(pair).forEach(group::addLogFile);
|
||||
|
||||
Reference in New Issue
Block a user