File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
datafusion/physical-expr/src/expressions Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -104,14 +104,6 @@ impl CastColumnExpr {
104104 input_schema : Arc < Schema > ,
105105 ) -> Result < Self > {
106106 let cast_options = normalize_cast_options ( cast_options) ;
107- let expr_data_type = expr. data_type ( input_schema. as_ref ( ) ) ?;
108- if input_field. data_type ( ) != & expr_data_type {
109- return plan_err ! (
110- "CastColumnExpr input field data type '{}' does not match expression data type '{}'" ,
111- input_field. data_type( ) ,
112- expr_data_type
113- ) ;
114- }
115107 if let Some ( column) = expr. as_any ( ) . downcast_ref :: < Column > ( ) {
116108 let fields = input_schema. fields ( ) ;
117109 let Some ( schema_field) = fields. get ( column. index ( ) ) else {
@@ -134,6 +126,14 @@ impl CastColumnExpr {
134126 ) ;
135127 }
136128 }
129+ let expr_data_type = expr. data_type ( input_schema. as_ref ( ) ) ?;
130+ if input_field. data_type ( ) != & expr_data_type {
131+ return plan_err ! (
132+ "CastColumnExpr input field data type '{}' does not match expression data type '{}'" ,
133+ input_field. data_type( ) ,
134+ expr_data_type
135+ ) ;
136+ }
137137
138138 match ( input_field. data_type ( ) , target_field. data_type ( ) ) {
139139 ( DataType :: Struct ( source_fields) , DataType :: Struct ( target_fields) ) => {
You can’t perform that action at this time.
0 commit comments