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

[GitHub] [arrow-datafusion] alamb opened a new pull request, #6612: Minor: Move functionality into `BuildInScalarFunction`

alamb opened a new pull request, #6612:
URL: https://github.com/apache/arrow-datafusion/pull/6612

   # Which issue does this PR close?
   
   N/A
   (though inspired by #5781 )
   
   # Rationale for this change
   
   
   This has been a pet peeve of mine and I think it makes working with this code harder than needed as  finding important functionality like "what is the signature of this function" harder because they aren't documented on https://docs.rs/datafusion-expr/26.0.0/datafusion_expr/enum.BuiltinScalarFunction.html
   
   
   # What changes are included in this PR?
   
   1. Move `signature`, `return_type` and `generate_signature_error_msg`  to functions on `BuiltinScalarFunction`
   2. Mark the existing functions as deprecated
   
   
   # Are these changes tested?
   existing coverage
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   # Are there any user-facing changes?
   
   Hopefully easier to navigate code
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


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


[GitHub] [arrow-datafusion] alamb merged pull request #6612: Minor: Move functionality into `BuildInScalarFunction`

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #6612:
URL: https://github.com/apache/arrow-datafusion/pull/6612


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


[GitHub] [arrow-datafusion] jackwener commented on a diff in pull request #6612: Minor: Move functionality into `BuildInScalarFunction`

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on code in PR #6612:
URL: https://github.com/apache/arrow-datafusion/pull/6612#discussion_r1225812477


##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -107,7 +105,7 @@ impl ExprSchemable for Expr {
                     .iter()
                     .map(|e| e.get_type(schema))
                     .collect::<Result<Vec<_>>>()?;
-                function::return_type(fun, &data_types)
+                fun.return_type(&data_types)

Review Comment:
   >  (I hope to apply the same pattern to window_function::return_type and aggregate_function::return_type
   
   🚀agree with it



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


[GitHub] [arrow-datafusion] alamb commented on pull request #6612: Minor: Move functionality into `BuildInScalarFunction`

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #6612:
URL: https://github.com/apache/arrow-datafusion/pull/6612#issuecomment-1603085844

   >> (I hope to apply the same pattern to window_function::return_type and aggregate_function::return_type
   
   > 🚀agree with it
   
   I finally had a chance to whip this out:  https://github.com/apache/arrow-datafusion/pull/6748


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


[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #6612: Minor: Move functionality into `BuildInScalarFunction`

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #6612:
URL: https://github.com/apache/arrow-datafusion/pull/6612#discussion_r1224179928


##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -107,7 +105,7 @@ impl ExprSchemable for Expr {
                     .iter()
                     .map(|e| e.get_type(schema))
                     .collect::<Result<Vec<_>>>()?;
-                function::return_type(fun, &data_types)
+                fun.return_type(&data_types)

Review Comment:
   this is a pretty good example of the point of this PR -- the functionality is now part of `fun` rather than a free function that takes `&self` as its first argument



##########
datafusion/expr/src/function_err.rs:
##########
@@ -1,125 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one

Review Comment:
   This is recently added code from @2010YOUY01 (which was awesome) which I simply moved into `BuiltInScalarFunction`



##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -107,7 +105,7 @@ impl ExprSchemable for Expr {
                     .iter()
                     .map(|e| e.get_type(schema))
                     .collect::<Result<Vec<_>>>()?;
-                function::return_type(fun, &data_types)
+                fun.return_type(&data_types)

Review Comment:
   (I hope to apply the same pattern to `window_function::return_type` and `aggregate_function::return_type`



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