You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/12/20 21:10:37 UTC

Re: [PR] Add `arrow_err!` macros, optional backtrace to ArrowError [arrow-datafusion]

alamb commented on code in PR #8586:
URL: https://github.com/apache/arrow-datafusion/pull/8586#discussion_r1433186142


##########
datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs:
##########
@@ -802,7 +802,7 @@ impl<'a, S: SimplifyInfo> TreeNodeRewriter for Simplifier<'a, S> {
                 && !info.get_data_type(&left)?.is_floating()
                 && is_zero(&right) =>
             {
-                return Err(DataFusionError::ArrowError(ArrowError::DivideByZero));
+                return plan_err!("Divide by zero");

Review Comment:
   Is the idea that since the error wasn't actually generated by Arrow then we shouldn't return an Arrow error?
   
   In theory having a structured `ArrowError` would be more specific than a general PlanError with a "Divide by zero" message, but I am not sure how much it matters 🤷 



-- 
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-unsubscribe@arrow.apache.org

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