Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Zouxxyy committed Mar 26, 2024
1 parent 2edefe1 commit d3c9c2b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public MergeTreeSplitGenerator(

@Override
public List<SplitGroup> splitForBatch(List<DataFileMeta> files) {
boolean rawConvertible = files.stream().allMatch(this::rawConvertible);
boolean rawConvertible =
files.stream().allMatch(file -> file.level() != 0 && withoutDeleteRow(file));
boolean oneLevel =
files.stream().map(DataFileMeta::level).collect(Collectors.toSet()).size() == 1;

Expand Down Expand Up @@ -102,7 +103,7 @@ public List<SplitGroup> splitForBatch(List<DataFileMeta> files) {
return packSplits(sections).stream()
.map(
f ->
f.size() == 1 && rawConvertible(f.get(0))
f.size() == 1 && withoutDeleteRow(f.get(0))
? SplitGroup.rawConvertibleGroup(f)
: SplitGroup.nonRawConvertibleGroup(f))
.collect(Collectors.toList());
Expand Down Expand Up @@ -142,8 +143,7 @@ private List<DataFileMeta> flatFiles(List<List<DataFileMeta>> section) {
return files;
}

private boolean rawConvertible(DataFileMeta dataFileMeta) {
return dataFileMeta.level() != 0
&& dataFileMeta.deleteRowCount().map(count -> count == 0L).orElse(false);
private boolean withoutDeleteRow(DataFileMeta dataFileMeta) {
return dataFileMeta.deleteRowCount().map(count -> count == 0L).orElse(false);
}
}

0 comments on commit d3c9c2b

Please sign in to comment.