QuakeWang commented on code in PR #224:
URL: https://github.com/apache/paimon-rust/pull/224#discussion_r3049348697
##########
crates/paimon/src/table/table_scan.rs:
##########
@@ -310,6 +310,48 @@ pub struct TableScan<'a> {
row_ranges: Option<Vec<RowRange>>,
}
+/// Apply a limit-pushdown hint to the generated splits.
+///
+/// Iterates through splits and accumulates `merged_row_count()` until the
+/// limit hint is reached. Returns only the splits likely needed to satisfy
+/// that hint.
+///
+/// This does not guarantee an exact final row count. If a split's
+/// `merged_row_count()` is `None` (for example because of unknown deletion
+/// cardinality), that split is kept even though its contribution to the
+/// limit is unknown. Planning may still stop early later if the
+/// accumulated known `merged_row_count()` reaches the limit, and the
+/// caller or query engine must enforce the final LIMIT.
+pub fn prune_splits_by_limit_hint(
Review Comment:
Good point.
I kept this logic internal in `TableScan` and removed the extra public
helper. I also added the regression coverage back for `limit == 0` and unknown
`merged_row_count()` so the original limit-hint behavior stays unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]