You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/18 10:35:47 UTC

[GitHub] [arrow-datafusion] Ted-Jiang commented on a diff in pull request #2566: Support limit push down for offset_plan

Ted-Jiang commented on code in PR #2566:
URL: https://github.com/apache/arrow-datafusion/pull/2566#discussion_r875738493


##########
datafusion/core/src/sql/planner.rs:
##########
@@ -296,9 +296,10 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
 
         let plan = self.order_by(plan, query.order_by)?;
 
-        let plan: LogicalPlan = self.offset(plan, query.offset)?;
+        let plan: LogicalPlan = self.limit(plan, query.limit)?;
 
-        self.limit(plan, query.limit)
+        //make limit as offset's input will enable limit push down simply
+        self.offset(plan, query.offset)

Review Comment:
   If there is an `offset` in sql, we will put it as root node in plan tree. So it will easily push `new_limit` to limit operator.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org