Skip to content

Commit 0ff66fc

Browse files
committed
Add expression & input schema name consistency check back
1 parent 910029d commit 0ff66fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

datafusion/physical-expr/src/equivalence/projection.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use crate::PhysicalExpr;
2222

2323
use arrow::datatypes::SchemaRef;
2424
use datafusion_common::tree_node::{Transformed, TransformedResult, TreeNode};
25-
use datafusion_common::Result;
25+
use datafusion_common::{internal_err, Result};
2626

2727
/// Stores the mapping between source expressions and target expressions for a
2828
/// projection.
@@ -66,8 +66,8 @@ impl ProjectionMapping {
6666
let idx = col.index();
6767
let matching_input_field = input_schema.field(idx);
6868
if col.name() != matching_input_field.name() {
69-
let fixed_col = Column::new(col.name(), idx);
70-
return Ok(Transformed::yes(Arc::new(fixed_col)));
69+
return internal_err!("Input field name {} does not match with the projection expression {}",
70+
matching_input_field.name(),col.name())
7171
}
7272
let matching_input_column =
7373
Column::new(matching_input_field.name(), idx);

0 commit comments

Comments
 (0)