Skip to content

Commit

Permalink
fix: improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Sep 6, 2022
1 parent bba3997 commit c3f9f27
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions datafusion/physical-expr/src/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ pub fn create_physical_expr(
execution_props: &ExecutionProps,
) -> Result<Arc<dyn PhysicalExpr>> {
if input_schema.fields.len() != input_dfschema.fields().len() {
return Err(DataFusionError::Internal(
"create_physical_expr passed Arrow schema and DataFusion \
schema with different number of fields"
.to_string(),
));
return Err(DataFusionError::Internal(format!(
"create_physical_expr expected same number of fields, got \
got Arrow schema with {} and DataFusion schema with {}",
input_schema.fields.len(),
input_dfschema.fields().len()
)));
}
match e {
Expr::Alias(expr, ..) => Ok(create_physical_expr(
Expand Down

0 comments on commit c3f9f27

Please sign in to comment.