andygrove commented on code in PR #2566:
URL: https://github.com/apache/arrow-datafusion/pull/2566#discussion_r878184860


##########
datafusion/core/src/sql/planner.rs:
##########
@@ -4847,6 +4861,29 @@ mod tests {
         quick_test(sql, expected);
     }
 
+    #[test]
+    fn test_offset_after_limit_with_limit_push() {
+        let sql = "select id from person where person.id > 100 LIMIT 5 OFFSET 
3;";
+        let expected = "Offset: 3\
+                                    \n  Limit: 8\
+                                    \n    Projection: #person.id\
+                                    \n      Filter: #person.id > Int64(100)\
+                                    \n        TableScan: person 
projection=None";
+
+        quick_test_with_limit_pushdown(sql, expected);
+    }
+
+    #[test]
+    fn test_offset_before_limit_with_limit_push() {
+        let sql = "select id from person where person.id > 100 OFFSET 3 LIMIT 
5;";
+        let expected = "Offset: 3\
+                                    \n  Limit: 8\
+                                    \n    Projection: #person.id\
+                                    \n      Filter: #person.id > Int64(100)\
+                                    \n        TableScan: person 
projection=None";
+        quick_test_with_limit_pushdown(sql, expected);
+    }
+

Review Comment:
   Thanks! That makes it much clearer



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