Skip to content

Conversation

@LatrecheYasser
Copy link
Contributor

@LatrecheYasser LatrecheYasser commented Oct 25, 2024

Which issue does this PR close?

This PR replaces adds the operation name modulus which is the standard Substrait operation name for mod

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the substrait Changes to the substrait crate label Oct 25, 2024
@LatrecheYasser LatrecheYasser marked this pull request as draft October 25, 2024 12:36
@LatrecheYasser LatrecheYasser changed the title Replace mod with the standard substrait name modulus (Draft) Replace mod with the standard substrait name modulus Oct 25, 2024
@LatrecheYasser LatrecheYasser force-pushed the replace_mode_with_modulus branch from af82001 to 0d500a9 Compare October 25, 2024 12:40
@LatrecheYasser LatrecheYasser changed the title (Draft) Replace mod with the standard substrait name modulus (Draft) Add Support for modulus operation Oct 25, 2024
"subtract" => Some(Operator::Minus),
"multiply" => Some(Operator::Multiply),
"divide" => Some(Operator::Divide),
"mod" => Some(Operator::Modulo),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@LatrecheYasser LatrecheYasser changed the title (Draft) Add Support for modulus operation Add Support for modulus operation Oct 25, 2024
@LatrecheYasser LatrecheYasser marked this pull request as ready for review October 25, 2024 12:44
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alamb alamb changed the title Add Support for modulus operation Add Support for modulus operation in substrait Oct 25, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems good to me -- thank you @LatrecheYasser and @vbarua

My only concern is that it isn't tested (and no tests needed to be updated either).

But maybe that is ok, as this PR doesn't improve / make the testing situation worse

@Blizzara
Copy link
Contributor

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

@LatrecheYasser
Copy link
Contributor Author

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

@alamb
Copy link
Contributor

alamb commented Oct 29, 2024

Thank you @LatrecheYasser and @Blizzara

I am sorry for the delay in merging this

@alamb alamb merged commit d00a089 into apache:main Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

substrait Changes to the substrait crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants