-
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
Change error type of invalid argument to PlanError rather than InternalError, remove misleading comments #7355
Conversation
@@ -737,8 +732,7 @@ impl BuiltinScalarFunction { | |||
Utf8 => List(Arc::new(Field::new("item", Utf8, true))), | |||
Null => Null, | |||
_ => { | |||
// this error is internal as `data_types` should have captured this. | |||
return internal_err!( | |||
return plan_err!( |
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.
it is true that this is currently caught by higher up type checks, but I think it is better to throw a plan error here to tell users about the problem if something changes rather than throw a confusing internal error
Also given that this code is often copy/pasted it probably should default to returning a nice error message rather than an opaque one
Thank you @DDtKey ! |
@jackwener / @liukun4515 / @Dandandan -- here is an example of a PR that has been reviewed by contributors but that I can't merge due to the restriction put in place by #7226 What is the reason we want to require an approval from one of the committers prior to merging? |
Thank you @Dandandan |
Which issue does this PR close?
related to #6108 and #7326
related to #7339
Rationale for this change
Inspired by @Weijun-H 's change in #7339 I was trying to clean up a comment I saw left over from #7339 I realized that not only are the comments in the rest of this file misleading the same bug also applied to several other functions.
Specifically, despite the comment claims that "this should have been covered earlier" it is clearly not and some of these error paths are directly user visible due to invalid queries (and thus should be plan errors, not internal errors). For example
What changes are included in this PR?
Are these changes tested?
Yes
Are there any user-facing changes?
yes, better error messages