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

Implement monotonicity for ScalarUDF #8756

Closed
guojidan opened this issue Jan 5, 2024 · 2 comments · Fixed by #8799
Closed

Implement monotonicity for ScalarUDF #8756

guojidan opened this issue Jan 5, 2024 · 2 comments · Fixed by #8799
Labels
enhancement New feature or request

Comments

@guojidan
Copy link
Contributor

guojidan commented Jan 5, 2024

Is your feature request related to a problem or challenge?

part of #8045 .

Now ScalarUDF is not supported monotonicity -- this means that certain sort related optimizations can not be applied to expressions that use ScalarUDF.

Describe the solution you'd like

No response

Describe alternatives you've considered

I think ScalarUDF's monotonicity should defined by User-self, so we can add monotonicity function for ScalarUDFImpl trait, like this:

pub trait ScalarUDFImpl {
    fn monotonicity() -> Result<Option<FuncMonotonicity>> {
        Ok(None)
    }
}

Additional context

No response

@guojidan guojidan added the enhancement New feature or request label Jan 5, 2024
@guojidan
Copy link
Contributor Author

guojidan commented Jan 5, 2024

cc @alamb, Is there any mistake in my understanding? if not I will implement this.

@alamb
Copy link
Contributor

alamb commented Jan 5, 2024

cc @alamb, Is there any mistake in my understanding? if not I will implement this.

Thank you @guojidan -- I agree this looks good. I also added it to the tracking epic in #8045

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

Successfully merging a pull request may close this issue.

2 participants