AdamGS commented on code in PR #20111:
URL: https://github.com/apache/datafusion/pull/20111#discussion_r2755196939


##########
datafusion/physical-expr/src/simplifier/unwrap_cast.rs:
##########
@@ -49,14 +46,12 @@ pub(crate) fn unwrap_cast_in_comparison(
     expr: Arc<dyn PhysicalExpr>,
     schema: &Schema,
 ) -> Result<Transformed<Arc<dyn PhysicalExpr>>> {
-    expr.transform_down(|e| {
-        if let Some(binary) = e.as_any().downcast_ref::<BinaryExpr>()
-            && let Some(unwrapped) = try_unwrap_cast_binary(binary, schema)?
-        {
-            return Ok(Transformed::yes(unwrapped));
-        }
-        Ok(Transformed::no(e))
-    })
+    if let Some(binary) = expr.as_any().downcast_ref::<BinaryExpr>()

Review Comment:
   this significantly changes the behavior of the function, we can move the 
logic into an internal private function and keep this public one



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to