getChan commented on code in PR #14371:
URL: https://github.com/apache/datafusion/pull/14371#discussion_r1938313572


##########
datafusion/common/src/error.rs:
##########
@@ -131,6 +131,10 @@ pub enum DataFusionError {
     /// Errors from either mapping LogicalPlans to/from Substrait plans
     /// or serializing/deserializing protobytes to Substrait plans
     Substrait(String),
+
+    /// Errors for wrapping other errors.

Review Comment:
   Because if we only pass the underlying error, we can't share the error (due 
to ownership constraints). For example, `RepartitionExec` needs to send errors 
to all output partitions. You can see this in the source code.
   
https://github.com/apache/datafusion/blob/8d006a287c653e8305827ad909c407baa7ed59fd/datafusion/physical-plan/src/repartition/mod.rs#L914-L921
   
   To share the error, I considered the following.
   1. `Implement Clone for DataFusionError` and use `err.clone()`: This is not 
possible because nested Error types do not implement the`Clone` trait.
   2. Pass `Arc<DatafusionError>` : I implemented it this way.



-- 
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