Skip to content
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 #1097

Merged

Conversation

margarit-h
Copy link
Contributor

@margarit-h margarit-h commented Nov 23, 2022

  • Add cbrt function to the PPL

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::

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)`;
fetched rows / total rows = 2/2
+-----------+---------------+-------------+
| CBRT(8)   | CBRT(9.261)   | CBRT(-27)   |
|-----------+---------------+-------------|
| 2.0       | 2.1           | -3.0        |
| 2.0       | 2.1           | -3.0        |
+-----------+---------------+-------------+

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

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.

* Add cbrt function to the PPL

Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2022

Codecov Report

Merging #1097 (77de5e5) into 2.x (d4d289c) will decrease coverage by 35.52%.
The diff coverage is n/a.

@@              Coverage Diff              @@
##                2.x    #1097       +/-   ##
=============================================
- Coverage     98.28%   62.76%   -35.53%     
=============================================
  Files           345       10      -335     
  Lines          8588      658     -7930     
  Branches        547      119      -428     
=============================================
- Hits           8441      413     -8028     
- Misses          142      192       +50     
- Partials          5       53       +48     
Flag Coverage Δ
query-workbench 62.76% <ø> (?)
sql-engine ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...main/java/org/opensearch/sql/executor/QueryId.java
...rg/opensearch/sql/ppl/domain/PPLQueryResponse.java
...ch/request/system/OpenSearchCatIndicesRequest.java
...us/planner/logical/rules/MergeAggAndIndexScan.java
...c/main/java/org/opensearch/sql/ppl/PPLService.java
...ch/sql/opensearch/planner/physical/MLOperator.java
.../storage/script/filter/ExpressionFilterScript.java
...nsearch/response/error/OpenSearchErrorMessage.java
...rch/sql/expression/aggregation/TakeAggregator.java
...rg/opensearch/sql/data/model/ExprBooleanValue.java
... and 345 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes!

@Yury-Fridlyand Yury-Fridlyand merged commit e2bf254 into opensearch-project:2.x Nov 28, 2022
@Yury-Fridlyand Yury-Fridlyand deleted the integ-add-cbrt-to-ppl branch November 28, 2022 19:08
@dai-chen dai-chen added enhancement New feature or request PPL Piped processing language labels Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PPL Piped processing language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants