Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discuss including Clip arithmetic operator #366

Closed
amoeba opened this issue Nov 2, 2022 · 2 comments
Closed

Discuss including Clip arithmetic operator #366

amoeba opened this issue Nov 2, 2022 · 2 comments

Comments

@amoeba
Copy link
Contributor

amoeba commented Nov 2, 2022

clip is an uncommon but handy arithmetic operation that can as be expressed as a combination of the more common operations least/greatest. None of these exist in Substrait though there's an open PR for least/greatest.

For example,

import numpy as np

a = np.arange(10) # => array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

np.minimum(np.maximum(a, 4), 6) # => array([4, 4, 4, 4, 4, 5, 6, 6, 6, 6])
np.clip(a, 4, 6) # => array([4, 4, 4, 4, 4, 5, 6, 6, 6, 6])

#307 (comment) sets out to establish guidelines on scope which leads me to think this might be too specialized to be included in Substrait but I thought I'd post an issue to get some feedback on whether this might be on scope for Substrait.

@amoeba amoeba changed the title Discuss including clip arithmetic operator Discuss including Clip arithmetic operator Nov 2, 2022
@westonpace
Copy link
Member

I agree this is too specialized given the guidance in #307 . However, it seems generally useful. I'm going to close this issue. If we want to pursue this function then I would encourage you to create a new project with a mandate defined similar to #307. This can then be an issue on that new project.

@amoeba
Copy link
Contributor Author

amoeba commented Mar 9, 2023

Thanks for circling back on this, @westonpace. I don't have any plans to pursue this at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants