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 #1807

Merged

Conversation

matthewryanwells
Copy link
Contributor

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.

acarbonetto
acarbonetto previously approved these changes Jul 4, 2023
Yury-Fridlyand
Yury-Fridlyand previously approved these changes Jul 4, 2023
@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Merging #1807 (158571f) into main (1ec696d) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main    #1807      +/-   ##
============================================
+ Coverage     97.30%   97.33%   +0.02%     
- Complexity     4442     4490      +48     
============================================
  Files           388      394       +6     
  Lines         11000    11118     +118     
  Branches        785      795      +10     
============================================
+ Hits          10704    10822     +118     
  Misses          289      289              
  Partials          7        7              
Flag Coverage Δ
sql-engine 97.33% <100.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
...ain/java/org/opensearch/sql/analysis/Analyzer.java 100.00% <100.00%> (ø)
...rg/opensearch/sql/analysis/ExpressionAnalyzer.java 100.00% <100.00%> (ø)
...va/org/opensearch/sql/analysis/NestedAnalyzer.java 100.00% <100.00%> (ø)
...nsearch/sql/analysis/SelectExpressionAnalyzer.java 100.00% <100.00%> (ø)
...a/org/opensearch/sql/analysis/TypeEnvironment.java 100.00% <100.00%> (ø)
...rg/opensearch/sql/analysis/symbol/SymbolTable.java 100.00% <100.00%> (ø)
...implementation/SparkSqlFunctionImplementation.java 100.00% <100.00%> (ø)
...ctions/resolver/SparkSqlTableFunctionResolver.java 100.00% <100.00%> (ø)
...nctions/scan/SparkSqlFunctionTableScanBuilder.java 100.00% <100.00%> (ø)
...ensearch/sql/spark/storage/SparkStorageEngine.java 100.00% <100.00%> (ø)
... and 3 more

GumpacG
GumpacG previously approved these changes Jul 4, 2023
docs/user/ppl/functions/datetime.rst Show resolved Hide resolved
@matthewryanwells matthewryanwells force-pushed the integ-ppl-function-support branch 3 times, most recently from 188a792 to 158571f Compare July 7, 2023 18:14
* Added new functions, and alias' to PPL

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
…ay as those dates don't exist

Signed-off-by: Matthew Wells <matthew.wells@improving.com>
Signed-off-by: Matthew Wells <matthew.wells@improving.com>
@MaxKsyunz MaxKsyunz merged commit e44d983 into opensearch-project:main Jul 11, 2023
15 checks passed
opensearch-trigger-bot bot 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>
(cherry picked from commit e44d983)
penghuo 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>
(cherry picked from commit e44d983)

Co-authored-by: Matthew Wells <matthew.wells@improving.com>
opensearch-trigger-bot bot 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>
(cherry picked from commit e44d983)
Yury-Fridlyand 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>
(cherry picked from commit e44d983)

Co-authored-by: Matthew Wells <matthew.wells@improving.com>
MitchellGale pushed a commit to Bit-Quill/opensearch-project-sql 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 to Bit-Quill/opensearch-project-sql 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 to Bit-Quill/opensearch-project-sql 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>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants