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

[GitHub] [arrow-datafusion] jayzhan211 opened a new pull request, #6471: Substrait: Support Expr::ScalarFunction

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

   # 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.
   -->
   
   Closes #6411.
   
   # 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.  
   -->
   
   # 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.
   -->
   
   Currently, we had supported Subtrait::ScalarFunction to DF::BinaryExpr when args len is 2. Now, we support Subtrait::ScalarFunction to DF::ScalarFunction for arbitrary args len except for 2.
   
   # Are these changes tested?
   
   <!--
   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)?
   -->
   
   ScalarFunction::Abs is tested.
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   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 commented on a diff in pull request #6471: Substrait: Support Expr::ScalarFunction

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


##########
datafusion/substrait/src/logical_plan/consumer.rs:
##########
@@ -97,6 +102,27 @@ pub fn name_to_op(name: &str) -> Result<Operator> {
     }
 }
 
+fn name_to_scalar_function(name: &str) -> Result<BuiltinScalarFunction> {
+    match name {

Review Comment:
   I wonder if you can use `FromStr` for this: https://github.com/apache/arrow-datafusion/blob/2bbc5063fefcc51ca98300e74b1bbc19ef4827ad/datafusion/expr/src/built_in_function.rs#L445-L458
   
   So like 
   ```rust
   let func = BuiltinScalarFunction::from_str(name)?;
   ```
   
   Or perhaps you need a different list of names to match what is in substrait 🤔 



-- 
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 #6471: Substrait: Support Expr::ScalarFunction

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

   cc @nseekhao 


-- 
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] nseekhao commented on pull request #6471: Substrait: Support Expr::ScalarFunction

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

   LGTM. Thank you so much, @jayzhan211 !


-- 
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] jayzhan211 commented on pull request #6471: Substrait: Support Expr::ScalarFunction

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

   Thanks for your review, code is updated and ready for review.


-- 
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 #6471: Substrait: Support Expr::ScalarFunction

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


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