alamb commented on code in PR #3969:
URL: https://github.com/apache/arrow-datafusion/pull/3969#discussion_r1008385320


##########
datafusion/physical-expr/src/expressions/cast.rs:
##########
@@ -93,6 +94,36 @@ impl PhysicalExpr for CastExpr {
         let value = self.expr.evaluate(batch)?;
         cast_column(&value, &self.cast_type, &self.cast_options)
     }
+
+    fn children(&self) -> Vec<Arc<dyn PhysicalExpr>> {
+        vec![self.expr.clone()]
+    }
+
+    fn with_new_children(
+        self: Arc<Self>,
+        children: Vec<Arc<dyn PhysicalExpr>>,
+    ) -> Result<Arc<dyn PhysicalExpr>> {
+        Ok(Arc::new(CastExpr::new(
+            children[0].clone(),
+            self.cast_type.clone(),
+            CastOptions {
+                safe: self.cast_options.safe,
+            },
+        )))
+    }
+}
+
+impl PartialEq<dyn Any> for CastExpr {
+    fn eq(&self, other: &dyn Any) -> bool {
+        down_cast_any_ref(other)
+            .downcast_ref::<Self>()
+            .map(|x| {
+                self.expr.eq(&x.expr)
+                    && self.cast_type == x.cast_type

Review Comment:
   Added a todo note in https://github.com/apache/arrow-datafusion/pull/4012



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to