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 GET_FORMAT Function To OpenSearch SQL Plugin #210

Merged

Conversation

GabeFernandez310
Copy link

@GabeFernandez310 GabeFernandez310 commented Jan 24, 2023

Description

Adds the get_format function to the OpenSearch SQL Plugin. It's implementation is aligned with the MySQL Documentation.

Note: This currently only supports a USA format for DATE, TIME, and DATETIME

Examples:

opensearchsql> SELECT get_format(DATE, 'USA');
fetched rows / total rows = 1/1
+---------------------------+
| get_format(DATE, 'USA')   |
|---------------------------|
| %m.%d.%Y                  |
+---------------------------+
opensearchsql> SELECT DATE_FORMAT('2003-10-03',GET_FORMAT(DATE,'USA'));
fetched rows / total rows = 1/1
+----------------------------------------------------+
| DATE_FORMAT('2003-10-03',GET_FORMAT(DATE,'USA'))   |
|----------------------------------------------------|
| 10.03.2003                                         |
+----------------------------------------------------+
opensearchsql> SELECT DATE_FORMAT('2003-10-03', null);
fetched rows / total rows = 1/1
+-----------------------------------+
| DATE_FORMAT('2003-10-03', null)   |
|-----------------------------------|
| null                              |
+-----------------------------------+

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.

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

codecov bot commented Jan 24, 2023

Codecov Report

❗ No coverage uploaded for pull request base (integ-add-get_format-function@6a90fe6). Click here to learn what that means.
The diff coverage is n/a.

@@                       Coverage Diff                        @@
##             integ-add-get_format-function     #210   +/-   ##
================================================================
  Coverage                                 ?   98.35%           
  Complexity                               ?     3606           
================================================================
  Files                                    ?      343           
  Lines                                    ?     8930           
  Branches                                 ?      568           
================================================================
  Hits                                     ?     8783           
  Misses                                   ?      142           
  Partials                                 ?        5           
Flag Coverage Δ
sql-engine 98.35% <0.00%> (?)

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

@GabeFernandez310 GabeFernandez310 marked this pull request as ready for review January 24, 2023 19:40
@GabeFernandez310 GabeFernandez310 requested a review from a team January 24, 2023 19:40
Copy link

@forestmvey forestmvey left a comment

Choose a reason for hiding this comment

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

Few items I'd like addressed.

Signed-off-by: GabeFernandez310 <[email protected]>
Signed-off-by: GabeFernandez310 <[email protected]>
Signed-off-by: GabeFernandez310 <[email protected]>
Signed-off-by: GabeFernandez310 <[email protected]>
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 merged commit 7a65740 into integ-add-get_format-function Jan 27, 2023
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.

5 participants