Skip to content

Conversation

@GabeFernandez310
Copy link

Description

Adds the month_of_year function to the SQL plugin. It behaves like the month function which already exists in the new engine, and both are aligned with MySQL

Issues Resolved

opensearch-project#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.

Signed-off-by: GabeFernandez310 <[email protected]>
Signed-off-by: GabeFernandez310 <[email protected]>
@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Merging #174 (b71c37e) into integ-add-month_of_year-function (e280866) will decrease coverage by 2.52%.
The diff coverage is 100.00%.

@@                          Coverage Diff                           @@
##             integ-add-month_of_year-function     #174      +/-   ##
======================================================================
- Coverage                               98.28%   95.75%   -2.53%     
- Complexity                               3450     3451       +1     
======================================================================
  Files                                     345      355      +10     
  Lines                                    8580     9241     +661     
  Branches                                  547      666     +119     
======================================================================
+ Hits                                     8433     8849     +416     
- Misses                                    142      334     +192     
- Partials                                    5       58      +53     
Flag Coverage Δ
query-workbench 62.76% <ø> (?)
sql-engine 98.28% <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%> (ø)
...h/public/components/QueryLanguageSwitch/Switch.tsx 85.71% <0.00%> (ø)
workbench/public/components/SQLPage/SQLPage.tsx 100.00% <0.00%> (ø)
workbench/public/components/Header/Header.tsx 100.00% <0.00%> (ø)
workbench/public/utils/PanelWrapper.tsx 100.00% <0.00%> (ø)
...ublic/components/QueryResults/QueryResultsBody.tsx 68.32% <0.00%> (ø)
workbench/public/components/PPLPage/PPLPage.tsx 56.52% <0.00%> (ø)
workbench/public/components/app.tsx 0.00% <0.00%> (ø)
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Signed-off-by: GabeFernandez310 <[email protected]>
@GabeFernandez310 GabeFernandez310 changed the title Add Month Of Year Function To OpenSearch Add Month_Of_Year Function To OpenSearch Nov 22, 2022
@GabeFernandez310 GabeFernandez310 marked this pull request as ready for review November 22, 2022 23:03
@GumpacG
Copy link

GumpacG commented Nov 23, 2022

If it makes sense, could there be IT tests for datetime values and null values? Could also make a query on calcs with columns that have null values.

Signed-off-by: GabeFernandez310 <[email protected]>
Signed-off-by: GabeFernandez310 <[email protected]>
Signed-off-by: GabeFernandez310 <[email protected]>
Signed-off-by: GabeFernandez310 <[email protected]>
@GabeFernandez310 GabeFernandez310 requested a review from a team November 29, 2022 17:20
Signed-off-by: GabeFernandez310 <[email protected]>
@GabeFernandez310
Copy link
Author

If it makes sense, could there be IT tests for datetime values and null values? Could also make a query on calcs with columns that have null values.

Fixed in b71c37e

Copy link

@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

@GabeFernandez310 GabeFernandez310 merged commit e34cac0 into integ-add-month_of_year-function Nov 30, 2022
@GabeFernandez310 GabeFernandez310 deleted the dev-add-month_of_year-function branch December 1, 2022 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants