MCPcopy Create free account
hub / github.com/apache/datafusion / plan_count_wildcard

Function plan_count_wildcard

datafusion/core/src/execution/session_state.rs:2567–2583  ·  view source on GitHub ↗

A helper method for planning count wildcard with or without expr planners.

(
            with_expr_planners: bool,
        )

Source from the content-addressed store, hash-verified

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;

Callers 1

test_with_expr_plannersFunction · 0.85

Calls 9

newFunction · 0.85
provider_as_sourceFunction · 0.85
with_tableMethod · 0.80
sql_to_statementMethod · 0.80
emptyFunction · 0.50
intoMethod · 0.45
with_expr_plannersMethod · 0.45
statement_to_planMethod · 0.45
create_physical_planMethod · 0.45

Tested by 1

test_with_expr_plannersFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…