Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions datafusion/proto-common/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

use datafusion_common::{internal_datafusion_err, DataFusionError};

/// Return a `DataFusionError::Internal` with the given message
pub fn proto_error<S: Into<String>>(message: S) -> DataFusionError {
internal_datafusion_err!("{}", message.into())
}
7 changes: 2 additions & 5 deletions datafusion/proto/src/logical_plan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,7 @@ impl AsLogicalPlan for LogicalPlanNode {
.as_ref()
.map(|expr| from_proto::parse_expr(expr, ctx, extension_codec))
.transpose()?
.ok_or_else(|| {
DataFusionError::Internal("expression required".to_string())
})?;
// .try_into()?;
.ok_or_else(|| proto_error("expression required"))?;
LogicalPlanBuilder::from(input).filter(expr)?.build()
}
LogicalPlanType::Window(window) => {
Expand Down Expand Up @@ -464,7 +461,7 @@ impl AsLogicalPlan for LogicalPlanNode {
.map(|col| {
let Some(arrow_type) = col.arrow_type.as_ref() else {
return Err(proto_error(
"Missing Arrow type in partition columns".to_string(),
"Missing Arrow type in partition columns",
));
};
let arrow_type = DataType::try_from(arrow_type).map_err(|e| {
Expand Down