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


##########
datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs:
##########
@@ -760,6 +766,29 @@ impl<'a, S: SimplifyInfo> ExprRewriter for Simplifier<'a, 
S> {
                 },
             },
 
+            // unfold the expression round(source, n)
+            Expr::ScalarFunction {
+                fun: BuiltinScalarFunction::Round,
+                args,

Review Comment:
   I would prefer that we don't re-write this in the logical plan to work 
around the fact that we don't currently support this in the physical plan. This 
makes the logical plan harder to use for other query engines, such as Dask SQL, 
that are using DataFusion for SQL query planning.
   
   I suggest for this PR that we throw an error in the physical query planner 
if we see `round` with two arguments. This would be better than producing 
incorrect results. We can implement the functionality in the physical plan in a 
separate PR.



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