| 440 | |
| 441 | #[test] |
| 442 | fn limit_pushdown_with_skip() -> Result<()> { |
| 443 | let table_scan = test_table_scan()?; |
| 444 | let noop_plan = LogicalPlan::Extension(Extension { |
| 445 | node: Arc::new(NoopPlan { |
| 446 | input: vec![table_scan.clone()], |
| 447 | schema: Arc::clone(table_scan.schema()), |
| 448 | }), |
| 449 | }); |
| 450 | |
| 451 | let plan = LogicalPlanBuilder::from(noop_plan) |
| 452 | .limit(10, Some(1000))? |
| 453 | .build()?; |
| 454 | |
| 455 | assert_optimized_plan_equal!( |
| 456 | plan, |
| 457 | @r" |
| 458 | Limit: skip=10, fetch=1000 |
| 459 | NoopPlan |
| 460 | Limit: skip=0, fetch=1010 |
| 461 | TableScan: test, fetch=1010 |
| 462 | " |
| 463 | ) |
| 464 | } |
| 465 | |
| 466 | #[test] |
| 467 | fn limit_pushdown_multiple_limits() -> Result<()> { |