You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
pubstructLimit{/// Number of rows to skip before fetchpubskip:Option<usize>,/// Maximum number of rows to fetchpubfetch:Option<usize>,/// The logical planpubinput:Arc<LogicalPlan>,}
Since skip = 0 and skip = None have same meaning, we can use pure usize to represent skip to reduce complexity.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
skip = None and skip = Some(0) are equivalent (forall plan, replacing skip = None with skip = 0 doesn't affect the result), so we don't need both of them.
This can avoid bugs in corner cases. While working on limit_push_down, I find there are lots of 'map_or, unwrap_or, ' and pattern matching with return, which is difficult to read and easy to have bug
We don't need to test skip=None, just to test skip=0 is enough.
Actually, I was a little confused about the meaning of skip = None, and fetch = None. And I misunderstood that skip = None meant skipping all rows (because fetch = None means fetching all rows). I am not sure if other users/developers have ever had this confusion.
Activity
HaoYang670 commentedon Sep 6, 2022
cc @alamb @andygrove @Dandandan .
Need your reviews, because this will cause some public API changes.
The reasons I want to do this are:
skip = Noneandskip = Some(0)are equivalent (forall plan, replacingskip = Nonewithskip = 0doesn't affect the result), so we don't need both of them.limit_push_down, I find there are lots of 'map_or, unwrap_or, ' and pattern matching withreturn, which is difficult to read and easy to have bugskip=None, just to testskip=0is enough.skip = None, andfetch = None. And I misunderstood thatskip = Nonemeant skipping all rows (becausefetch = Nonemeans fetching all rows). I am not sure if other users/developers have ever had this confusion.[-]Use `usize` to represent `LogicalPlan::Limit::skip`[/-][+]Use `usize` to represent `Limit::skip`[/+]alamb commentedon Sep 7, 2022
I think this proposal makes sense to me as well. I can't think of any issues with it