HaoYang670 commented on code in PR #4234:
URL: https://github.com/apache/arrow-datafusion/pull/4234#discussion_r1023593430


##########
datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs:
##########
@@ -728,6 +729,30 @@ impl<'a, S: SimplifyInfo> ExprRewriter for Simplifier<'a, 
S> {
                 },
             },
 
+            // unfold the expression round(source, n)
+            Expr::ScalarFunction {
+                fun: BuiltinScalarFunction::Round,
+                args,
+            } => match &args[..] {
+                [source, n] => {
+                    println!("I am here, source = {:?}, n = {:?}", source, n);
+                    let exp = Box::new(power(
+                        lit(10.0),
+                        Expr::Cast(Cast::new(n.clone().into(), 
DataType::Float64)),

Review Comment:
   One problem here is that we will always convert the data type to `Float64` 
to adapt the `power` function



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