-
Notifications
You must be signed in to change notification settings - Fork 0
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 CBRT to the V2 engine #166
Conversation
Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
Codecov Report
@@ Coverage Diff @@
## integ-add-cbrt-to-v2 #166 +/- ##
==========================================================
- Coverage 98.27% 95.71% -2.56%
- Complexity 3351 3355 +4
==========================================================
Files 327 337 +10
Lines 8457 9123 +666
Branches 553 672 +119
==========================================================
+ Hits 8311 8732 +421
- Misses 142 334 +192
- Partials 4 57 +53
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 |
core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/MathematicalFunction.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
* Test cbrt with long value. | ||
*/ | ||
@ParameterizedTest(name = "cbrt({0})") | ||
@ValueSource(longs = {1L, 2L}) |
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.
we could also test negative longs, and larger-than-2 longs
* Test cbrt with int value. | ||
*/ | ||
@ParameterizedTest(name = "cbrt({0})") | ||
@ValueSource(ints = {1, 2}) |
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.
negative integers?
* Test cbrt with float value. | ||
*/ | ||
@ParameterizedTest(name = "cbrt({0})") | ||
@ValueSource(floats = {1F, 2F}) |
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.
negative floats, or floats with more precision?
* Test cbrt with double value. | ||
*/ | ||
@ParameterizedTest(name = "cbrt({0})") | ||
@ValueSource(doubles = {1D, 2D}) |
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.
larger doubles, doubles with values below the decimal?
Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
* Add CBRT to the V2 engine (#166) Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com> * Fixes after rebase Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com> Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
Signed-off-by: Margarit Hakobyan margarith@bitquilltech.com
Description
Adds CBRT() math function to the V2 engine.
Usage: CBRT(number) calculates the cube root of a number
Argument type: INTEGER/LONG/FLOAT/DOUBLE
Return type: DOUBLE
(Non-negative) INTEGER/LONG/FLOAT/DOUBLE -> DOUBLE
(Negative) INTEGER/LONG/FLOAT/DOUBLE -> DOUBLE
Example::
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.