-
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
Minor: Move function signature check to planning stage #9401
Conversation
data_types(&arg_data_types, fun.signature()).map_err(|_| { | ||
plan_datafusion_err!( | ||
"{}", | ||
utils::generate_signature_error_msg( | ||
fun.name(), | ||
fun.signature().clone(), | ||
&arg_data_types, | ||
) | ||
) | ||
})?; |
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.
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.
Nice! 👍
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 @2010YOUY01
Thats good start to unify error messages if signature cannot be found
@@ -84,7 +84,7 @@ statement error Error during planning: No function matches the given name and ar | |||
SELECT concat(); | |||
|
|||
# error message for wrong function signature (Uniform: t args all from some common types) | |||
statement error DataFusion error: Failed to coerce arguments for NULLIF | |||
statement error DataFusion error: Error during planning: No function matches the given name and argument types 'nullif\(Int64\)'. You might need to add explicit type casts. |
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 is a much nicer error message
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.
Thank you @2010YOUY01 (and welcome back!)
Let me merge this nice change |
Which issue does this PR close?
NA
Rationale for this change
I noticed a recent PR #9377 tried to check function argument number inside a specific function's implementation
It can be done at a higher level during planning (as it was in old builtin function implementation)
What changes are included in this PR?
Are these changes tested?
Covered by existing test introduced in #9377
Are there any user-facing changes?
No