-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When upgrading to DataFusion 40, I kept on encountering this error:
Internal error: Expected a simplified result, but none was found.
This happened when parsing a array literal. It seems in order to parse it, we need to register the proper ExprPlanner on the SessionState. We use SessionState::default(), which registers it for us. But then it's not being propagated to SqlToRel, so it fails. (Note the planners: vec![])
datafusion/datafusion/sql/src/planner.rs
Lines 206 to 213 in f204869
| pub fn new_with_options(context_provider: &'a S, options: ParserOptions) -> Self { | |
| let normalize = options.enable_ident_normalization; | |
| SqlToRel { | |
| context_provider, | |
| options, | |
| normalizer: IdentNormalizer::new(normalize), | |
| planners: vec![], |
To Reproduce
No response
Expected behavior
I'm not sure I understand the design, but it seems odd we don't propagate these. At the very least, we should provide a warning in the docs.
Additional context
Current workaround:
for planner in context_provider.state.expr_planners() {
sql_to_rel = sql_to_rel.with_user_defined_planner(planner.clone());
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working