-
Notifications
You must be signed in to change notification settings - Fork 707
feat(expr): support pow function #7789
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #7789 +/- ##
==========================================
- Coverage 71.68% 71.67% -0.01%
==========================================
Files 1100 1100
Lines 175690 175707 +17
==========================================
- Hits 125937 125936 -1
- Misses 49753 49771 +18
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| } | ||
|
|
||
| #[inline(always)] | ||
| pub fn general_pow<T1, T2, T3>(l: T1, r: T2) -> Result<T3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we cast them in frontend, I guess we can only support a concrete implementation (f64,f64)->f64 instead of a general one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
st1page
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
As per the title.
Right now, both x and y are casted into Float64 when pow(x, y).
By PG's standard, we also need to support Decimal but Decimal has no built-in pow and we may also change the underlying crate for Decimal. So we leave it aside for now.
Urgently requested by user.
#7725
Checklist
./risedev check(or alias,./risedev c)Documentation
If your pull request contains user-facing changes, please specify the types of the changes, and create a release note. Otherwise, please feel free to remove this section.
Types of user-facing changes
Please keep the types that apply to your changes, and remove those that do not apply.
Release note
Please create a release note for your changes. In the release note, focus on the impact on users, and mention the environment or conditions where the impact may occur.
powis a mathematical function, see https://www.postgresql.org/docs/7.4/functions-math.htmlBut this PR only implements for dp(double precision) as function parameters. Decimal has not been implemented yet.
Refer to a related PR or issue link (optional)
#7725