A helper method for planning count wildcard with or without expr planners.
(
with_expr_planners: bool,
)
| 2565 | async fn test_with_expr_planners() -> Result<()> { |
| 2566 | // A helper method for planning count wildcard with or without expr planners. |
| 2567 | async fn plan_count_wildcard( |
| 2568 | with_expr_planners: bool, |
| 2569 | ) -> Result<Arc<dyn ExecutionPlan>> { |
| 2570 | let mut context_provider = MyContextProvider::new().with_table( |
| 2571 | "t", |
| 2572 | provider_as_source(Arc::new(EmptyTable::new(Schema::empty().into()))), |
| 2573 | ); |
| 2574 | if with_expr_planners { |
| 2575 | context_provider = context_provider.with_expr_planners(); |
| 2576 | } |
| 2577 | |
| 2578 | let state = &context_provider.state; |
| 2579 | let statement = |
| 2580 | state.sql_to_statement("select count(*) from t", &Dialect::MySQL)?; |
| 2581 | let plan = SqlToRel::new(&context_provider).statement_to_plan(statement)?; |
| 2582 | state.create_physical_plan(&plan).await |
| 2583 | } |
| 2584 | |
| 2585 | // Planning count wildcard without expr planners should fail. |
| 2586 | let got = plan_count_wildcard(false).await; |
searching dependent graphs…