-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Make Diagnostic
easy/convinient to attach by using macro and avoiding map_err
#15796
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
Conversation
datafusion/sql/src/expr/function.rs
Outdated
Diagnostic::new_error(format!("Invalid function '{name}'"), span); | ||
diagnostic | ||
.add_note(format!("Possible function '{}'", suggested_func_name), None); | ||
plan_err!("Invalid function '{name}'.\nDid you mean '{suggested_func_name}'?"; diag=diagnostic) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to use ;
which is a bit weird, but works, is this acceptable @comphead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that would be not very obvious it is true.
@logan-keede please run the planner tests to check if this change affects planner performance, we got some experience in the past #7522 |
cargo bench --bench sql_planner bench.txt UPD: I ran them again a couple of times and they seem to be giving variable results. This pattern seems to be persisting over main branch too. so, it probably should not be a blocker. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm thanks @logan-keede
…ng `map_err` (apache#15796) * First Step * Final Step? * Homogenisation
Which issue does this PR close?
Originally posted by @comphead in #15680 (comment)
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?