-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExprPlanner not propagated to SqlToRel #11477
Comments
@jayzhan211 could you confirm what the intended behavior is for this? |
We assume planner should exist, at least with datafusion's builtin one, otherwise we don't know how to handle it thus throws error for the case. |
After #11403, I think you can easily get the default planners with SessionStateBuilder::new()
.with_default_features()
.build() |
I'm not sure I understand your answer. When we call What I'm confused by is that I have to do this additional step to propagate it to let session_state: SessionState = ...;
let mut sql_to_rel = SqlToRel::new(...);
for planner in session_state.expr_planners() {
sql_to_rel = sql_to_rel.with_user_defined_planner(planner.clone());
} Why do I have to do that? Why doesn't |
This comment was marked as outdated.
This comment was marked as outdated.
I see. Let me see if it is possible to avoid the additional copied |
Cross referencing -- a related discussion on #11180 #11180 (comment) |
Describe the bug
When upgrading to DataFusion 40, I kept on encountering this error:
This happened when parsing a array literal. It seems in order to parse it, we need to register the proper
ExprPlanner
on theSessionState
. We useSessionState::default()
, which registers it for us. But then it's not being propagated toSqlToRel
, so it fails. (Note theplanners: vec![]
)datafusion/datafusion/sql/src/planner.rs
Lines 206 to 213 in f204869
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:
The text was updated successfully, but these errors were encountered: