-
Notifications
You must be signed in to change notification settings - Fork 141
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
Support user-defined and incomplete date formats (#273) #1821
Merged
MaxKsyunz
merged 2 commits into
opensearch-project:main
from
Bit-Quill:integ-custom-datetime-formats
Jul 11, 2023
Merged
Support user-defined and incomplete date formats (#273) #1821
MaxKsyunz
merged 2 commits into
opensearch-project:main
from
Bit-Quill:integ-custom-datetime-formats
Jul 11, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Check custom formats for characters Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Removed duplicated code Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Reworked checking for exprcoretype Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Changed check for time Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Rework processing custom and incomplete formats and add tests. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Values of incomplete and incorrect formats to be returned as `TIMESTAMP` instead of `STRING`. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Complete fix and update tests. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * More fixes for god of fixes. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> --------- Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Yury-Fridlyand
requested review from
pjfitzgibbons,
ps48,
kavithacm,
derek-ho,
joshuali925,
dai-chen,
YANG-DB,
rupal-bq,
mengweieric,
vmmusings,
Swiddis,
penghuo,
seankao-az,
MaxKsyunz,
anirudha,
forestmvey,
acarbonetto and
GumpacG
as code owners
July 8, 2023 02:04
Codecov Report
@@ Coverage Diff @@
## main #1821 +/- ##
============================================
+ Coverage 97.33% 97.35% +0.01%
- Complexity 4490 4524 +34
============================================
Files 394 394
Lines 11118 11180 +62
Branches 795 812 +17
============================================
+ Hits 10822 10884 +62
Misses 289 289
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
forestmvey
previously approved these changes
Jul 10, 2023
GumpacG
previously approved these changes
Jul 10, 2023
opensearch/src/main/java/org/opensearch/sql/opensearch/data/type/OpenSearchDateType.java
Show resolved
Hide resolved
penghuo
previously approved these changes
Jul 10, 2023
6 tasks
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Yury-Fridlyand
dismissed stale reviews from penghuo, GumpacG, and forestmvey
via
July 10, 2023 22:22
be8c34f
GumpacG
approved these changes
Jul 10, 2023
forestmvey
approved these changes
Jul 10, 2023
MaxKsyunz
approved these changes
Jul 11, 2023
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Jul 11, 2023
* Support user-defined and incomplete date formats (#273) * Check custom formats for characters Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Removed duplicated code Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Reworked checking for exprcoretype Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Changed check for time Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Rework processing custom and incomplete formats and add tests. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Values of incomplete and incorrect formats to be returned as `TIMESTAMP` instead of `STRING`. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Complete fix and update tests. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * More fixes for god of fixes. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> --------- Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Refactoring. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> --------- Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Guian Gumpac <guian.gumpac@improving.com> (cherry picked from commit a60b222)
Yury-Fridlyand
added a commit
that referenced
this pull request
Jul 11, 2023
* Support user-defined and incomplete date formats (#273) * Check custom formats for characters Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Removed duplicated code Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Reworked checking for exprcoretype Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Changed check for time Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Rework processing custom and incomplete formats and add tests. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Values of incomplete and incorrect formats to be returned as `TIMESTAMP` instead of `STRING`. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Complete fix and update tests. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * More fixes for god of fixes. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> --------- Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Refactoring. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> --------- Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Guian Gumpac <guian.gumpac@improving.com> (cherry picked from commit a60b222) Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Jul 11, 2023
* Support user-defined and incomplete date formats (#273) * Check custom formats for characters Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Removed duplicated code Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Reworked checking for exprcoretype Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Changed check for time Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Rework processing custom and incomplete formats and add tests. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Values of incomplete and incorrect formats to be returned as `TIMESTAMP` instead of `STRING`. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Complete fix and update tests. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * More fixes for god of fixes. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> --------- Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Refactoring. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> --------- Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Guian Gumpac <guian.gumpac@improving.com> (cherry picked from commit a60b222)
forestmvey
pushed a commit
that referenced
this pull request
Jul 11, 2023
* Support user-defined and incomplete date formats (#273) * Check custom formats for characters Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Removed duplicated code Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Reworked checking for exprcoretype Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Changed check for time Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Rework processing custom and incomplete formats and add tests. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Values of incomplete and incorrect formats to be returned as `TIMESTAMP` instead of `STRING`. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Complete fix and update tests. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * More fixes for god of fixes. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> --------- Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Refactoring. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> --------- Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Guian Gumpac <guian.gumpac@improving.com> (cherry picked from commit a60b222) Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
MitchellGale
pushed a commit
to Bit-Quill/opensearch-project-sql
that referenced
this pull request
Jul 11, 2023
…roject#1821) * Support user-defined and incomplete date formats (#273) * Check custom formats for characters Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Removed duplicated code Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Reworked checking for exprcoretype Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Changed check for time Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> * Rework processing custom and incomplete formats and add tests. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Values of incomplete and incorrect formats to be returned as `TIMESTAMP` instead of `STRING`. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Complete fix and update tests. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> * More fixes for god of fixes. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> --------- Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com> * Refactoring. Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> --------- Signed-off-by: Guian Gumpac <guian.gumpac@improving.com> Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Guian Gumpac <guian.gumpac@improving.com> Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
This was referenced Jul 12, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
year
,week_year
), but limitations applied. See below Limitations section.Please, see team review and discussion in Bit-Quill#273
Fixes #126, related issue: #794
Notes
Limitations
Bit-Quill#273 (comment)
date/time part from custom formats which does not provide complete date/time part could be lost.
For example:
"1999-10-20 15"
with format"yyyy-MM-dd mm"
parsed as1999-10-20 00:00:00
"1999 10:20"
with format"yyyy HH:mm"
parsed as1970-01-01 10:20:00
This comes from OpenSearch core libs, track opensearch-project/OpenSearch#8689.
Sample for test
Mapping:
Data:
Sample 2
Mapping
Data
Query
Result set
Sample 3
Use
calcs
from ITQuery
Result set
Check List
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.