-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
add sign math function #19527
add sign math function #19527
Conversation
@ucasfl could you please add documentation to 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.
Looks good to me.
src/Functions/sign.cpp
Outdated
ColumnWithTypeAndName right{zero_column, arguments[0].type, {}}; | ||
|
||
auto greater = FunctionFactory::instance().get("greater", context); | ||
auto greater_compare = greater->build(ColumnsWithTypeAndName{left, right}); |
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.
@ucasfl maybe it make sense to extract that ColumnsWithTypeAndName{left, right}
in variable without creating it for each function execute
in next lines ?
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.
Done!
Ok. |
@ucasfl after small discussion maybe it will be better to implement it using existing framework FunctionUnaryArithmetic? |
Ok, I have rewrite it with FunctionUnaryArithmetic. |
I checked that obfuscator can't obfuscate reserve words like function name, so I made a little change on this test. |
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.
@ucasfl looks good to me, lets wait for CI and merge.
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add
sign
math function.