-
Notifications
You must be signed in to change notification settings - Fork 594
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
feat(expr): Various trigonometric functions #8838
Conversation
src/common/src/types/decimal.rs
Outdated
#[must_use] | ||
pub fn sin(&self) -> Self { |
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.
FYI In PostgreSQL, trigonometric functions are only defined for double precision. Inputs of other types are implicitly casted to double precision, and the output is always double precision.
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.
Thank you for pointing that out :)
src/workspace-hack/Cargo.toml
Outdated
@@ -18,191 +18,191 @@ publish = false | |||
|
|||
### BEGIN HAKARI SECTION | |||
[dependencies] | |||
ahash = { version = "0.8" } | |||
anyhow = { version = "1", features = ["backtrace"] } | |||
ahash = { version = "0.8", features = ["getrandom", "runtime-rng", "std"] } |
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.
These changes were added after risedev c
query R | ||
SELECT cot(1) | ||
---- | ||
0.642092615934331 |
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.
This file is not run by the CI. It needs to be named as trigonometric.slt.part
.
And you can run it locally:
sqllogictest -p 4566 -d dev './e2e_test/batch/functions/trigonometric.slt.part'
Thank you for your feedback. I changed the tests slightly (see 7d53b64). These are mostly rounding errors. I assume those differences are ok? |
I think so. PostgreSQL also includes similar disclaimer:
|
Codecov Report
@@ Coverage Diff @@
## main #8838 +/- ##
=======================================
Coverage 70.79% 70.80%
=======================================
Files 1180 1181 +1
Lines 195692 195772 +80
=======================================
+ Hits 138539 138615 +76
- Misses 57153 57157 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Implement the following math functions
sin
/cos
/tan
/cot
/asin
/acos
/atan
/atan2
Related PR: #8806
Checklist For Contributors
./risedev check
(or alias,./risedev c
)Checklist For Reviewers
Documentation
Click here for Documentation
Types of user-facing changes
Please keep the types that apply to your changes, and remove the others.
Release note