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

Added new datetime functions and aliases to PPL #281

Merged

Conversation

matthewryanwells
Copy link

Description

This PR adds multiple datetime functions and aliases to PPL.

The following aliases are added:

Alias Original Function
day_of_week dayofweek
day_of_month day
hour_of_day hour
minute_of_hour minute
second_of_minute second
day_of_year dayofyear
month_of_year month
week_of_year week

The following functions are added:

  • minute_of_day
  • time_format

Issues Resolved

No related issue

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.

…tests

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
Signed-off-by: Matthew Wells <matthew.wells@improving.com>
@codecov
Copy link

codecov bot commented Jun 30, 2023

Codecov Report

❗ No coverage uploaded for pull request base (integ-ppl-function-support@1ec696d). Click here to learn what that means.
The diff coverage is n/a.

@@                      Coverage Diff                      @@
##             integ-ppl-function-support     #281   +/-   ##
=============================================================
  Coverage                              ?   97.30%           
  Complexity                            ?     4442           
=============================================================
  Files                                 ?      388           
  Lines                                 ?    11000           
  Branches                              ?      785           
=============================================================
  Hits                                  ?    10704           
  Misses                                ?      289           
  Partials                              ?        7           
Flag Coverage Δ
sql-engine 97.30% <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

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
Signed-off-by: Matthew Wells <matthew.wells@improving.com>
Signed-off-by: Matthew Wells <matthew.wells@improving.com>
docs/user/ppl/functions/datetime.rst Outdated Show resolved Hide resolved
docs/user/ppl/functions/datetime.rst Outdated Show resolved Hide resolved
docs/user/ppl/functions/datetime.rst Outdated Show resolved Hide resolved
docs/user/ppl/functions/datetime.rst Outdated Show resolved Hide resolved
ppl/src/main/antlr/OpenSearchPPLLexer.g4 Outdated Show resolved Hide resolved
ppl/src/main/antlr/OpenSearchPPLParser.g4 Outdated Show resolved Hide resolved
…ation

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
ppl/src/main/antlr/OpenSearchPPLLexer.g4 Outdated Show resolved Hide resolved
Signed-off-by: Matthew Wells <matthew.wells@improving.com>
@matthewryanwells matthewryanwells merged commit 2c6c623 into integ-ppl-function-support Jul 4, 2023
@matthewryanwells matthewryanwells deleted the dev-ppl-function-support branch July 4, 2023 17:47
matthewryanwells added a commit that referenced this pull request Jul 7, 2023
* Added new functions, and alias' to PPL

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
matthewryanwells added a commit that referenced this pull request Jul 7, 2023
* Added new functions, and alias' to PPL

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
matthewryanwells added a commit that referenced this pull request Jul 11, 2023
)

* Added new datetime functions and aliases to PPL (#281)

* Added new functions, and alias' to PPL

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

* removed message about functions not working with dates with 0 month/day as those dates don't exist

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

* changed documentation to be in alphabetical order

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

---------

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
matthewryanwells added a commit that referenced this pull request Jul 11, 2023
* Added new functions, and alias' to PPL

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
matthewryanwells added a commit that referenced this pull request Jul 11, 2023
* Added new functions, and alias' to PPL

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
MitchellGale pushed a commit that referenced this pull request Jul 11, 2023
)

* Added new datetime functions and aliases to PPL (#281)

* Added new functions, and alias' to PPL

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

* removed message about functions not working with dates with 0 month/day as those dates don't exist

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

* changed documentation to be in alphabetical order

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

---------

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
MitchellGale pushed a commit that referenced this pull request Jul 11, 2023
)

* Added new datetime functions and aliases to PPL (#281)

* Added new functions, and alias' to PPL

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

* removed message about functions not working with dates with 0 month/day as those dates don't exist

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

* changed documentation to be in alphabetical order

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

---------

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
MitchellGale pushed a commit that referenced this pull request Jul 12, 2023
) (opensearch-project#1832)

* Added new datetime functions and aliases to PPL (#281)

* Added new functions, and alias' to PPL

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

* removed message about functions not working with dates with 0 month/day as those dates don't exist

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

* changed documentation to be in alphabetical order

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

---------

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
(cherry picked from commit e44d983)

Co-authored-by: Matthew Wells <matthew.wells@improving.com>
MitchellGale pushed a commit that referenced this pull request Jul 20, 2023
)

* Added new datetime functions and aliases to PPL (#281)

* Added new functions, and alias' to PPL

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

* removed message about functions not working with dates with 0 month/day as those dates don't exist

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

* changed documentation to be in alphabetical order

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

---------

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
Yury-Fridlyand pushed a commit that referenced this pull request Aug 22, 2023
) (opensearch-project#1838)

* Added new datetime functions and aliases to PPL (#281)

* Added new functions, and alias' to PPL

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

* removed message about functions not working with dates with 0 month/day as those dates don't exist

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

* changed documentation to be in alphabetical order

Signed-off-by: Matthew Wells <matthew.wells@improving.com>

---------

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
(cherry picked from commit e44d983)

Co-authored-by: Matthew Wells <matthew.wells@improving.com>
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