-
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 function to the PPL #171
Conversation
Codecov Report
@@ Coverage Diff @@
## integ-add-cbrt-to-ppl #171 +/- ##
===========================================================
- Coverage 98.28% 95.76% -2.53%
Complexity 3454 3454
===========================================================
Files 345 355 +10
Lines 8588 9246 +658
Branches 547 666 +119
===========================================================
+ Hits 8441 8854 +413
- Misses 142 334 +192
- Partials 5 58 +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 |
08bef27
to
d4d289c
Compare
Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
a2b928e
to
d820a1b
Compare
|
||
Example:: | ||
|
||
opensearchsql> source=location | eval `CBRT(8)` = CBRT(8), `CBRT(9.261)` = CBRT(9.261), `CBRT(-27)` = CBRT(-27) | fields `CBRT(8)`, `CBRT(9.261)`, `CBRT(-27)`; |
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 use source=people, do we just get a single row of results?
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.
No, we get 12 rows, locations
seems to be the shortest.
Here is the people
:
opensearchsql> source=people | eval CBRT(8)
= CBRT(8), CBRT(9.261)
= CBRT(9.261), CBRT(-27)
= CBRT(-27) | fields CBRT(8)
, CBRT(9.261)
,CBRT(-27)
;
fetched rows / total rows = 12/12
+-----------+---------------+-------------+
| CBRT(8) | CBRT(9.261) | CBRT(-27) |
|-----------+---------------+-------------|
| 2.0 | 2.1 | -3.0 |
| 2.0 | 2.1 | -3.0 |
| 2.0 | 2.1 | -3.0 |
| 2.0 | 2.1 | -3.0 |
| 2.0 | 2.1 | -3.0 |
| 2.0 | 2.1 | -3.0 |
| 2.0 | 2.1 | -3.0 |
| 2.0 | 2.1 | -3.0 |
| 2.0 | 2.1 | -3.0 |
| 2.0 | 2.1 | -3.0 |
| 2.0 | 2.1 | -3.0 |
| 2.0 | 2.1 | -3.0 |
+-----------+---------------+-------------+
If it makes sense, can there be more tests to test field types float, long, double, null, negative. Currently only integer is being tested in IT. |
@@ -662,3 +662,27 @@ Example:: | |||
| 2.0 | 2.1 | | |||
+-----------+--------------+ | |||
|
|||
CBRT |
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.
I think the functions in here might be organized in Alphabetical order? It might be good to move this function documentation up.
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!
* Add cbrt function to the PPL (#171) Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
* Import h3 library (#154) Made following changes to make it compatible: 1. Rename package from elasticsearch to opensearch.geospatial 2. Update License headers 3. Update build file 4. Update settings to include sub projects * Use Transport Request (#164) Remove usage of deprecated BaseNodeRequest * Update http client package to resolve build failure (#168) (#171) * Introduce H3 min resolution constant (#165) H3 version 1 has 16 resolutions, numbered 0 through 15. Introduced a constant to represent min value, similar to max value. * Add geohex aggregation (#160) This aggregation will use uber's h3 to group coordinates into H3 cell. Created new aggregation type geohex_grid. The precision will be between 0 and 15. This aggreation has default precision as 5, similar to geohash and geotile. Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com> * Add integration test (#176) Included integration test for geohex_grid. Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Margarit Hakobyan margarith@bitquilltech.com
Description
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.