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 sec_to_time Function To OpenSearch SQL #1378

Merged

Conversation

GabeFernandez310
Copy link
Contributor

@GabeFernandez310 GabeFernandez310 commented Feb 23, 2023

Description

Adds the sec_to_time function to the OpenSearch SQL plugin. It is based on MySQL documentation, but it does not allow negative dates.

Issues Resolved

#722

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.

* Added Tests

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>

* Added Implementation And Documentation

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>

* Added Integration Test And Fixed Checkstyle

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>

* Addressed PR Comments

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>

* Fixed Checkstyle

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>

* Added Tests And Modified Docs

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>

* Fixed formatNanos Helper Function

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>

* Temporarily Removed Failing Tests

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>

* Fixed Nanoseconds Float/Double Imprecision Issues

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>

* Fixed Checkstyle

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>

* Added Tests

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>

* Altered Implementation To Use BigDecimal

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>

---------

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>
@GabeFernandez310 GabeFernandez310 marked this pull request as ready for review March 8, 2023 21:49
@GabeFernandez310 GabeFernandez310 requested a review from a team as a code owner March 8, 2023 21:49
@codecov-commenter
Copy link

codecov-commenter commented Mar 10, 2023

Codecov Report

Merging #1378 (1680811) into main (ef38389) will increase coverage by 0.00%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff            @@
##               main    #1378   +/-   ##
=========================================
  Coverage     98.38%   98.39%           
- Complexity     3698     3703    +5     
=========================================
  Files           343      343           
  Lines          9121     9136   +15     
  Branches        586      586           
=========================================
+ Hits           8974     8989   +15     
  Misses          142      142           
  Partials          5        5           
Flag Coverage Δ
sql-engine 98.39% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...c/main/java/org/opensearch/sql/expression/DSL.java 100.00% <100.00%> (ø)
...arch/sql/expression/datetime/DateTimeFunction.java 100.00% <100.00%> (ø)
...h/sql/expression/function/BuiltinFunctionName.java 100.00% <100.00%> (ø)

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

Copy link
Collaborator

@acarbonetto acarbonetto left a comment

Choose a reason for hiding this comment

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

LGTM

@dai-chen dai-chen merged commit aa7f90e into opensearch-project:main Mar 15, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 15, 2023
* Added Tests

* Added Implementation And Documentation

* Added Integration Test And Fixed Checkstyle

* Addressed PR Comments

* Fixed Checkstyle

* Added Tests And Modified Docs

* Fixed formatNanos Helper Function

* Temporarily Removed Failing Tests

* Fixed Nanoseconds Float/Double Imprecision Issues

* Fixed Checkstyle

* Added Tests

* Altered Implementation To Use BigDecimal

---------

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>
(cherry picked from commit aa7f90e)
Yury-Fridlyand pushed a commit that referenced this pull request Mar 16, 2023
* Added Tests

* Added Implementation And Documentation

* Added Integration Test And Fixed Checkstyle

* Addressed PR Comments

* Fixed Checkstyle

* Added Tests And Modified Docs

* Fixed formatNanos Helper Function

* Temporarily Removed Failing Tests

* Fixed Nanoseconds Float/Double Imprecision Issues

* Fixed Checkstyle

* Added Tests

* Altered Implementation To Use BigDecimal

---------

Signed-off-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>
(cherry picked from commit aa7f90e)

Co-authored-by: GabeFernandez310 <Gabriel.Fernandez@improving.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants