avantgardnerio opened a new issue, #4957:
URL: https://github.com/apache/arrow-datafusion/issues/4957
**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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]