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

Function sql_to_expr

datafusion/core/src/execution/session_state.rs:2377–2391  ·  view source on GitHub ↗
(state: &SessionState)

Source from the content-addressed store, hash-verified

2375 // test array planners with and without builtin planners
2376 #[cfg(feature = "sql")]
2377 fn sql_to_expr(state: &SessionState) -> Result<Expr> {
2378 let provider = SessionContextProvider {
2379 state,
2380 tables: HashMap::new(),
2381 };
2382
2383 let sql = "[1,2,3]";
2384 let schema = Schema::new(vec![Field::new("a", DataType::Int32, true)]);
2385 let df_schema = DFSchema::try_from(schema)?;
2386 let dialect = state.config.options().sql_parser.dialect;
2387 let sql_expr = state.sql_to_expr(sql, &dialect)?;
2388
2389 let query = SqlToRel::new_with_options(&provider, state.get_parser_options());
2390 query.sql_to_expr(sql_expr, &df_schema, &mut PlannerContext::new())
2391 }
2392
2393 let state = SessionStateBuilder::new().with_default_features().build();
2394

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
get_parser_optionsMethod · 0.80
optionsMethod · 0.45
sql_to_exprMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…