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
So, how do we share the error?
1. `Implement Clone for DataFusionError`: 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]