apache / apache/paimon-trino

Bug: TrinoSplitManager will get the weight of split is a Nan if maxRowCount is 0

Open
#104 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
47
Forks
55
PR merge metrics
No merged PRs in 30d

Description

```
List 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 ?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.