-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Enhancement](nereids, function, test) add the cot math function #51574
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
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
| constexpr double epsilon = 1e-10; | ||
| double remainder = std::fmod(std::abs(x), M_PI); | ||
|
|
||
| return std::abs(x) < epsilon || std::abs(remainder) < epsilon || |
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.
just std::abs(remainder) < epsilon maybe is enough? this check seems could cover other two conditions. could you confirm this?
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.
also add some test with data in table
| double value = first.getValue(); | ||
| double remainder = Math.abs(value) % Math.PI; | ||
|
|
||
| if (Math.abs(value) < epsilon || Math.abs(remainder) < epsilon || Math.abs(remainder - Math.PI) < epsilon) { |
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.
seem with comment in BE
| InputTypeSet input_types = {PrimitiveType::TYPE_DOUBLE}; | ||
|
|
||
| DataSet data_set = {{{-1.0}, -0.6420926159343306}, {{0.5}, 1.830487721712452}, | ||
| {{1.0}, 0.6420926159343306}, {{0.0}, Null()}, |
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.
add a testcase return Null which input is not zero
TPC-H: Total hot run time: 34679 ms |
TPC-DS: Total hot run time: 189507 ms |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
|
finished by another pr:#52872 |
What problem does this PR solve?
Support the cot math function.
Related PR: #48203
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)