You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jackwener (via GitHub)" <gi...@apache.org> on 2023/05/08 13:24:18 UTC

[GitHub] [arrow-datafusion] jackwener opened a new pull request, #6281: refactor: Expr::ScalarFunction to use a struct

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

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Related to #2175 and #3807.
   
    # Rationale for this change
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   Continuing the work outlined in #3807 to bring `Expr` variants more in line with `LogicalPlan` variants.
   
   
   # What changes are included in this PR?
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   Refactors `Expr::ScalarFunction` to use a struct.
   
   # Are there any user-facing changes?
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   No
   
   <!--
   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] jackwener merged pull request #6281: refactor: Expr::ScalarFunction to use a struct

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


-- 
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 pull request #6281: refactor: Expr::ScalarFunction to use a struct

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

   Because there is a following PR to refactor ScalarUDF.
   
   So, I merge this PR to continue https://github.com/apache/arrow-datafusion/pull/6284. (otherwise, it will cause conflict)


-- 
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 #6281: refactor: Expr::ScalarFunction to use a struct

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


##########
datafusion/expr/src/expr.rs:
##########
@@ -353,6 +348,22 @@ impl Between {
     }
 }
 
+/// ScalarFunction expression
+#[derive(Clone, PartialEq, Eq, Hash)]
+pub struct ScalarFunction {
+    /// The function
+    pub fun: built_in_function::BuiltinScalarFunction,

Review Comment:
   I would love, long term, to remove the difference between `ScalarFunction` and `ScalarUDF` (aka have a single way of calling functions for built in and extension functions)



-- 
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 #6281: refactor: Expr::ScalarFunction to use a struct

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


##########
datafusion/expr/src/expr.rs:
##########
@@ -353,6 +348,22 @@ impl Between {
     }
 }
 
+/// ScalarFunction expression
+#[derive(Clone, PartialEq, Eq, Hash)]
+pub struct ScalarFunction {
+    /// The function
+    pub fun: built_in_function::BuiltinScalarFunction,

Review Comment:
   It's a great idea, add issue #6282 to track 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] jackwener commented on a diff in pull request #6281: refactor: Expr::ScalarFunction to use a struct

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


##########
datafusion/expr/src/expr.rs:
##########
@@ -353,6 +348,22 @@ impl Between {
     }
 }
 
+/// ScalarFunction expression
+#[derive(Clone, PartialEq, Eq, Hash)]
+pub struct ScalarFunction {
+    /// The function
+    pub fun: built_in_function::BuiltinScalarFunction,

Review Comment:
   It's a great idea, I trace it in https://github.com/apache/arrow-datafusion/issues/6282



-- 
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 pull request #6281: refactor: Expr::ScalarFunction to use a struct

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

   Because there is a following PR to refactor ScalarUDF.
   
   So, I merge this PR to continue 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