diff --git a/core/src/execution/datafusion/expressions/cast.rs b/core/src/execution/datafusion/expressions/cast.rs index 91066e0e2..d4bed07ca 100644 --- a/core/src/execution/datafusion/expressions/cast.rs +++ b/core/src/execution/datafusion/expressions/cast.rs @@ -203,7 +203,14 @@ impl PhysicalExpr for Cast { self: Arc, children: Vec>, ) -> datafusion_common::Result> { - 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,