-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
It's not really a bug, more of an API regression. When #4607 got merged, consumers of the DataFusion public API lost the ability to (easily) inspect or alter the AST of a SQL statement before it got planned. This is because the function that runs it became non-trivial in that it copies tables into a new context, so now the consumer would either have to duplicate the table copying logic, or go without.
To Reproduce
This used to work:
let statements = DFParser::parse_sql(sql)?;
let statements: Vec<_> = statements.into_iter().collect();
// Do something with AST here
let state = df_ctx.state();
let planner = SqlToRel::new(&state);
let plan = planner.statement_to_plan(stmt).map_err(|e| err!("", e))?;
let df = Arc::new(DataFrame::new(df_ctx.state(), plan));
But now it yields: ContextProvider not implented for SessionState
Expected behavior
A way to parse, manipulate AST, then plan separately.
gruuya
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working