ming535 commented on PR #2638:
URL: 
https://github.com/apache/arrow-datafusion/pull/2638#issuecomment-1140904805

   > c70f3378a9364603023924670b8bb0d | ac16e18018a438445e12492bf018cf0f | male
   >  13 | 78cecc
   
   In pg, the order of "offset" and "limit" doen't matter. It always means 
"OFFSET rows are skipped before starting to count the LIMIT rows that are 
returned".
   
   In the logical plan tree, the order of "offset" and “limit” does matter.
   
   This PR makes several "assumptions":
   1. The builder api should be independent of SQL language, it only describes 
the logical tree structure. 
   2. When users use the builder api to construct the plan tree. If "limit" is 
the parent of "offset", then the semantic is to ignore some rows first; 
otherwise, the semantic is to first count the number rows.
   3. When translating SQL to logical plan in the planner, we make "limit" to 
be the parent of "offset" to be compatible with pg.


-- 
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]

Reply via email to