Skip to content

Commit

Permalink
Update core/src/execution/datafusion/expressions/cast.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Edmondo Porcu <[email protected]>
  • Loading branch information
andygrove and edmondop authored Apr 19, 2024
1 parent 7169bad commit ef563eb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/src/execution/datafusion/expressions/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,14 @@ impl PhysicalExpr for Cast {
self: Arc<Self>,
children: Vec<Arc<dyn PhysicalExpr>>,
) -> datafusion_common::Result<Arc<dyn PhysicalExpr>> {
Ok(Arc::new(Cast::new(
match children.len() {
1 => Ok(Arc::new(Cast::new(
children[0].clone(),
self.data_type.clone(),
self.timezone.clone(),
))),
_ => internal_err!("Cast should have exactly one child"),
}
children[0].clone(),
self.data_type.clone(),
self.eval_mode,
Expand Down

0 comments on commit ef563eb

Please sign in to comment.