Skip to content

Commit 9970687

Browse files
committed
fix
1 parent 4f9eee9 commit 9970687

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

datafusion/physical-expr/src/schema_rewriter.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,11 @@ impl<'a> PhysicalExprSchemaRewriter<'a> {
177177
);
178178
}
179179

180-
let cast_expr =
181-
Arc::new(CastExpr::new(expr, logical_field.data_type().clone(), None));
180+
let cast_expr = Arc::new(CastExpr::new(
181+
Arc::new(column),
182+
logical_field.data_type().clone(),
183+
None,
184+
));
182185

183186
Ok(Transformed::yes(cast_expr))
184187
}
@@ -280,9 +283,9 @@ mod tests {
280283
let (physical_schema, logical_schema) = create_test_schema();
281284

282285
let rewriter = PhysicalExprSchemaRewriter::new(&physical_schema, &logical_schema);
283-
let column_expr = Arc::new(Column::new("b", 1));
286+
let column_expr = Arc::new(Column::new("b", 1)) as Arc<dyn PhysicalExpr>;
284287

285-
let result = rewriter.rewrite(column_expr.clone())?;
288+
let result = rewriter.rewrite(Arc::clone(&column_expr))?;
286289

287290
// Should be the same expression (no transformation needed)
288291
// We compare the underlying pointer through the trait object

0 commit comments

Comments
 (0)