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

Function plan_sql

datafusion/sql/tests/sql_integration.rs:5049–5061  ·  view source on GitHub ↗
(sql: &str)

Source from the content-addressed store, hash-verified

5047 );
5048
5049 fn plan_sql(sql: &str) -> LogicalPlan {
5050 let options = ParserOptions::default();
5051 let dialect = &GenericDialect {};
5052 let state = MockSessionState::default()
5053 .with_scalar_function(make_array_udf())
5054 .with_expr_planner(Arc::new(CustomExprPlanner {}))
5055 .with_type_planner(Arc::new(CustomTypePlanner {}));
5056 let context = MockContextProvider { state };
5057 let planner = SqlToRel::new_with_options(&context, options);
5058 let result = DFParser::parse_sql_with_dialect(sql, dialect);
5059 let mut ast = result.unwrap();
5060 planner.statement_to_plan(ast.pop_front().unwrap()).unwrap()
5061 }
5062
5063 let plan = plan_sql(sql);
5064

Callers 1

test_custom_type_planFunction · 0.70

Calls 6

newFunction · 0.85
with_scalar_functionMethod · 0.80
pop_frontMethod · 0.80
with_type_plannerMethod · 0.45
with_expr_plannerMethod · 0.45
statement_to_planMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…