2010YOUY01 commented on issue #11618:
URL: https://github.com/apache/datafusion/issues/11618#issuecomment-2245388504

   We should definitely explain them better in the doc. 
   Here is my understanding. I'm wondering if anyone has additional thoughts or 
if I'm understanding something wrong.
   
   ## Planning Error
   1. The planner will first check the argument type based on the function 
signature, and raise `PlanningError` if input arg is wrong. (It could be hard 
to specify the behavior, link to the actual checking code might help...)
   2. For some edge case planning can't do comprehensive arg type check, 
further argument check can be performed in `return_type()`, here we should 
return `PlanningError` if input argument is wrong
   3. It's possible there are some existing UDF implementations that hacked 
input argument checking logic into `invoke()`...which should not be encouraged
   
   ## Execution Error
   1. Inside `invoke()`, when there is any expected error (e.g. something like 
divide by 0), explicitly return `ExecutionError`, I think it's better not to 
directly return lower level error messages like `ArrowError`, which might be 
hard to interpret sometimes.
   2. Inside `invoke()` if there are some branches that should be unreachable, 
throw `InternalError` in such branches. If such a branch is executed there 
might be a potential bug, we want to fail fast in this case.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to