You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "LatrecheYasser (via GitHub)" <gi...@apache.org> on 2024/10/25 12:32:37 UTC

[PR] Replace `mod` with the standard substrait name `modulus` [datafusion]

LatrecheYasser opened a new pull request, #13108:
URL: https://github.com/apache/datafusion/pull/13108

   ## Which issue does this PR close?
   
   This PR replaces the operation name `mod` by `modulus` to match the standard [Substrait operation name](https://substrait.io/extensions/functions_arithmetic/#modulus).  
   
   ## 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.
   -->
   
   ## 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)?
   -->
   
   ## 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.
   -->
   Using mod instead of modulus will disrupt the substrait consumption for some substrait plans.


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Replace `mod` with the standard substrait name `modulus` [datafusion]

Posted by "LatrecheYasser (via GitHub)" <gi...@apache.org>.
LatrecheYasser commented on code in PR #13108:
URL: https://github.com/apache/datafusion/pull/13108#discussion_r1816599123


##########
datafusion/substrait/src/logical_plan/consumer.rs:
##########
@@ -107,7 +107,7 @@ pub fn name_to_op(name: &str) -> Option<Operator> {
         "subtract" => Some(Operator::Minus),
         "multiply" => Some(Operator::Multiply),
         "divide" => Some(Operator::Divide),
-        "mod" => Some(Operator::Modulo),

Review Comment:
   maybe we need to keep both versions and mark this as deprecated somehow?



-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Add Support for `modulus` operation in substrait [datafusion]

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

   LGTM. Tests don’t need updating as we mainly test the roundtrips (I didn’t check if we test even that for this specific function, but even if we did, it still would just keep passing.) I dunno if it makes sense to manually test all functions, but I think nowdays the substrait-rs might include the Substrait default function definition yamls so we could maybe do something to compare the produced functions against them (which would have caught the ”mod” before)..


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Add Support for `modulus` operation in substrait [datafusion]

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

   cc @alamb  @Blizzara 
   I've added a simple roundtrip test case for modulus in  766dacae7f47f165bfe73f8ea5a086f99a8f19dc


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Add Support for `modulus` operation in substrait [datafusion]

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

   Thank you everyone!


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Add Support for `modulus` operation in substrait [datafusion]

Posted by "vbarua (via GitHub)" <gi...@apache.org>.
vbarua commented on code in PR #13108:
URL: https://github.com/apache/datafusion/pull/13108#discussion_r1817248874


##########
datafusion/substrait/src/logical_plan/consumer.rs:
##########
@@ -108,6 +108,7 @@ pub fn name_to_op(name: &str) -> Option<Operator> {
         "multiply" => Some(Operator::Multiply),
         "divide" => Some(Operator::Divide),
         "mod" => Some(Operator::Modulo),

Review Comment:
   I'm not sure how to produce a deprecation warning for this programatically.
   
   However, we can provide an easy migration path if we also update the producer code to use `modulus` so we can release a version of DataFusion that consumes `mod` and `modulus`, and produces only `modulus`. Then the version after than we remove `mod` and announce it as a breaking change in the release notes.



-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Add Support for `modulus` operation in substrait [datafusion]

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


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] (Draft) Replace `mod` with the standard substrait name `modulus` [datafusion]

Posted by "LatrecheYasser (via GitHub)" <gi...@apache.org>.
LatrecheYasser commented on code in PR #13108:
URL: https://github.com/apache/datafusion/pull/13108#discussion_r1816599123


##########
datafusion/substrait/src/logical_plan/consumer.rs:
##########
@@ -107,7 +107,7 @@ pub fn name_to_op(name: &str) -> Option<Operator> {
         "subtract" => Some(Operator::Minus),
         "multiply" => Some(Operator::Multiply),
         "divide" => Some(Operator::Divide),
-        "mod" => Some(Operator::Modulo),

Review Comment:
   maybe we need to keep both versions and mark this as deprecated somehow?



-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] (Draft) Add Support for `modulus` operation [datafusion]

Posted by "LatrecheYasser (via GitHub)" <gi...@apache.org>.
LatrecheYasser commented on code in PR #13108:
URL: https://github.com/apache/datafusion/pull/13108#discussion_r1816616919


##########
datafusion/substrait/src/logical_plan/consumer.rs:
##########
@@ -108,6 +108,7 @@ pub fn name_to_op(name: &str) -> Option<Operator> {
         "multiply" => Some(Operator::Multiply),
         "divide" => Some(Operator::Divide),
         "mod" => Some(Operator::Modulo),

Review Comment:
   because `mod` is the same as `modulus` we need to mark it as deprecated somehow, but how?  



-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org