-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
List<Split> splits = readBuilder.dropStats().newScan().plan().splits();
long maxRowCount = splits.stream().mapToLong(Split::rowCount).max().orElse(0L);
double minimumSplitWeight = TrinoSessionProperties.getMinimumSplitWeight(session);
return new TrinoSplitSource(
splits.stream()
.map(
split ->
TrinoSplit.fromSplit(
split,
// Math.min/max will return Nan if any value is Nan
Math.min(
Math.max(
// 0/0 is Nan
(double) split.rowCount() / maxRowCount,
minimumSplitWeight
),
1.0
)
)
)
.collect(Collectors.toList()),
connectorTableHandle.getLimit());
}
As comment bellow, is it better for TrinoSplitManager return a empty split or just give a default weight for zero row split ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels