You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Weijun-H (via GitHub)" <gi...@apache.org> on 2023/09/15 15:10:12 UTC

[GitHub] [arrow-datafusion] Weijun-H commented on a diff in pull request #7568: feat: natively support more data types for the `abs` function.

Weijun-H commented on code in PR #7568:
URL: https://github.com/apache/arrow-datafusion/pull/7568#discussion_r1327431169


##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -883,14 +883,14 @@ mod test {
     fn scalar_function() -> Result<()> {
         let empty = empty();
         let lit_expr = lit(10i64);
-        let fun: BuiltinScalarFunction = BuiltinScalarFunction::Abs;
+        let fun: BuiltinScalarFunction = BuiltinScalarFunction::Acos;
         let scalar_function_expr =
             Expr::ScalarFunction(ScalarFunction::new(fun, vec![lit_expr]));
         let plan = LogicalPlan::Projection(Projection::try_new(
             vec![scalar_function_expr],
             empty,
         )?);
-        let expected = "Projection: abs(CAST(Int64(10) AS Float64))\n  EmptyRelation";
+        let expected = "Projection: acos(CAST(Int64(10) AS Float64))\n  EmptyRelation";

Review Comment:
   ```suggestion
           let expected = "Projection: abs(Int64(10))\n  EmptyRelation";
   ```



##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -883,14 +883,14 @@ mod test {
     fn scalar_function() -> Result<()> {
         let empty = empty();
         let lit_expr = lit(10i64);
-        let fun: BuiltinScalarFunction = BuiltinScalarFunction::Abs;
+        let fun: BuiltinScalarFunction = BuiltinScalarFunction::Acos;

Review Comment:
   ```suggestion
           let fun: BuiltinScalarFunction = BuiltinScalarFunction::Abs;
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org