zhuqi-lucas opened a new pull request, #27892: URL: https://github.com/apache/datafusion/pull/27892
## Which issue does this PR close? - Closes #27891. ## Rationale for this change `LimitPushdown` passes a limit to the children of a node whose `limit_behavior` is `MoveToInput` or `CopyToChildren`. A leaf has no children, so the limit is dropped and the query returns too many rows. The default `limit_behavior` gives a leaf one of these when it still returns `true` from the deprecated `supports_limit_pushdown`. ## What changes are included in this PR? `LimitPushdown` treats such a leaf as `Stops`: the leaf takes the limit as its fetch, or the limit stays above it. ## Are these changes tested? Yes, 3 tests in `limit_pushdown.rs` with a leaf that declares `MoveToInput` or `CopyToChildren`: one that takes a fetch, the same with an OFFSET, and one that can't take a fetch. All three fail without the fix: the plan is the bare leaf. ## Are there any user-facing changes? A custom leaf that passes limits now gets the limit instead of losing it. Built-in leaves don't pass limits, so their plans don't change. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
