| 415 | } |
| 416 | #[test] |
| 417 | fn limit_pushdown_basic() -> Result<()> { |
| 418 | let table_scan = test_table_scan()?; |
| 419 | let noop_plan = LogicalPlan::Extension(Extension { |
| 420 | node: Arc::new(NoopPlan { |
| 421 | input: vec![table_scan.clone()], |
| 422 | schema: Arc::clone(table_scan.schema()), |
| 423 | }), |
| 424 | }); |
| 425 | |
| 426 | let plan = LogicalPlanBuilder::from(noop_plan) |
| 427 | .limit(0, Some(1000))? |
| 428 | .build()?; |
| 429 | |
| 430 | assert_optimized_plan_equal!( |
| 431 | plan, |
| 432 | @r" |
| 433 | Limit: skip=0, fetch=1000 |
| 434 | NoopPlan |
| 435 | Limit: skip=0, fetch=1000 |
| 436 | TableScan: test, fetch=1000 |
| 437 | " |
| 438 | ) |
| 439 | } |
| 440 | |
| 441 | #[test] |
| 442 | fn limit_pushdown_with_skip() -> Result<()> { |