Skip to content

Commit

Permalink
rename SharedError
Browse files Browse the repository at this point in the history
  • Loading branch information
getChan committed Feb 3, 2025
1 parent f1c34af commit d4e860f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions datafusion/common/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub enum DataFusionError {

/// Errors for wrapping other errors.
/// This is useful when we need to share DatafusionError.
WrappedError(Arc<DataFusionError>),
SharedError(Arc<DataFusionError>),
}

#[macro_export]
Expand Down Expand Up @@ -347,7 +347,7 @@ impl Error for DataFusionError {
DataFusionError::Context(_, e) => Some(e.as_ref()),
DataFusionError::Substrait(_) => None,
DataFusionError::Diagnostic(_, e) => Some(e.as_ref()),
DataFusionError::WrappedError(e) => Some(e.as_ref()),
DataFusionError::SharedError(e) => Some(e.as_ref()),
}
}
}
Expand Down Expand Up @@ -462,7 +462,7 @@ impl DataFusionError {
DataFusionError::Context(_, _) => "",
DataFusionError::Substrait(_) => "Substrait error: ",
DataFusionError::Diagnostic(_, _) => "",
DataFusionError::WrappedError(_) => "",
DataFusionError::SharedError(_) => "",
}
}

Expand Down Expand Up @@ -504,7 +504,7 @@ impl DataFusionError {
}
DataFusionError::Substrait(ref desc) => Cow::Owned(desc.to_string()),
DataFusionError::Diagnostic(_, ref err) => Cow::Owned(err.to_string()),
DataFusionError::WrappedError(ref desc) => Cow::Owned(desc.to_string()),
DataFusionError::SharedError(ref desc) => Cow::Owned(desc.to_string()),
}
}

Expand Down
4 changes: 2 additions & 2 deletions datafusion/physical-plan/src/joins/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ impl<T: 'static> OnceFut<T> {
OnceFutState::Ready(r) => Poll::Ready(
r.as_ref()
.map(|r| r.as_ref())
.map_err(|e| DataFusionError::WrappedError(Arc::clone(e))),
.map_err(|e| DataFusionError::SharedError(Arc::clone(e))),
),
}
}
Expand All @@ -1091,7 +1091,7 @@ impl<T: 'static> OnceFut<T> {
match &self.state {
OnceFutState::Pending(_) => unreachable!(),
OnceFutState::Ready(r) => {
Poll::Ready(r.clone().map_err(DataFusionError::WrappedError))
Poll::Ready(r.clone().map_err(DataFusionError::SharedError))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/repartition/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ impl RepartitionExec {

for (_, tx) in txs {
// wrap it because need to send error to all output partitions
let err = Err(DataFusionError::WrappedError(Arc::clone(&e)));
let err = Err(DataFusionError::SharedError(Arc::clone(&e)));
tx.send(Some(err)).await.ok();
}
}
Expand Down

0 comments on commit d4e860f

Please sign in to comment.