Minor: Fix error messages in array expressions#8781
Conversation
| pub fn array_except(args: &[ArrayRef]) -> Result<ArrayRef> { | ||
| if args.len() != 2 { | ||
| return internal_err!("array_except needs two arguments"); | ||
| return exec_err!("array_except needs two arguments"); |
There was a problem hiding this comment.
When to use internal_err, when to use exec_err?
There was a problem hiding this comment.
internal_err: something that wasn't expected/anticipated by the implementation and that is most likely a bug (the error message even encourages users to open a bug report). I user should not be able to trigger this under normal circumstances. Note that I/O errors (or any error that happens due to external systems) do NOT fall under this category (there's an external error variant for that)
exec_err: a processing error that happens during execution, e.g. the user passed malformed arguments to a SQL method, opened a CSV file that is broken, tried to divide an integer by zero. these errors shouldn't happen for a "good" query + "good" data, but since both the query and the data can easily be broken or misaligned, these are common occurrences in ETL systems / databases.
There was a problem hiding this comment.
This is such a great explanation I figured I would encode it in the comments of DataFusionError in its own PR: #8792
|
Thanks @Weijun-H and @crepererum |
…n.rs to exec_err! Signed-off-by: tangruilin <tang.ruilin@foxmail.com>
…o exec_err! (#9083) Signed-off-by: tangruilin <tang.ruilin@foxmail.com>
Which issue does this PR close?
Closes #.
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?