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 support for date_nanos and tests. #337

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

Yury-Fridlyand
Copy link

Description

Restore support for date_nanos type. Initially was added in opensearch-project#360 and removed in opensearch-project#1314 by mistake.

Issues Resolved

opensearch-project#1954

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.

@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Merging #337 (25a2007) into integ-add-date-nanos-2.x (5381a6f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@                     Coverage Diff                     @@
##             integ-add-date-nanos-2.x     #337   +/-   ##
===========================================================
  Coverage                       97.51%   97.51%           
  Complexity                       4656     4656           
===========================================================
  Files                             408      408           
  Lines                           11930    11931    +1     
  Branches                          829      829           
===========================================================
+ Hits                            11634    11635    +1     
  Misses                            289      289           
  Partials                            7        7           
Flag Coverage Δ
sql-engine 97.51% <100.00%> (+<0.01%) ⬆️

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

Files Changed Coverage Δ
...h/sql/opensearch/data/type/OpenSearchDataType.java 100.00% <100.00%> (ø)

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

@acarbonetto
Copy link

acarbonetto commented Aug 14, 2023

@Yury-Fridlyand we should add tests to parallel the expected features of date_nanos.

+ " FROM %s", TEST_INDEX_DATE_FORMATS);
JSONObject result = executeQuery(query);
verifySchema(result,
schema("hour_minute_second_OR_t_time", null, "time"));

Choose a reason for hiding this comment

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

can you change this to hour_minute_second_millis instead? The point of using the date_nano type is to include fractions of a second.

Copy link
Author

Choose a reason for hiding this comment

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

I use t_time here, it includes up to 9 digits of fsp.

Choose a reason for hiding this comment

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

but the verifyDataRows doesn't include any units of precision? Maybe include data that has fractions of a second?

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
@Yury-Fridlyand
Copy link
Author

@Yury-Fridlyand we should add tests to parallel the expected features of date_nanos.

Added tests and rebased on upstream/main.

@Yury-Fridlyand Yury-Fridlyand merged commit 8ef676b into integ-add-date-nanos-2.x Aug 16, 2023
19 of 20 checks passed
@Yury-Fridlyand Yury-Fridlyand deleted the dev-add-date-nanos-2.x branch August 16, 2023 21:25
MitchellGale pushed a commit that referenced this pull request Aug 21, 2023
* Add support for `date_nanos` and tests. (#337)

* Add support for `date_nanos` and tests.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Add more IT.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

---------

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Typo fix in IT.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Address PR feedback.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Spotless

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

---------

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Yury-Fridlyand added a commit that referenced this pull request Aug 22, 2023
* Add support for `date_nanos` and tests. (#337)

* Add support for `date_nanos` and tests.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Add more IT.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

---------

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Typo fix in IT.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Address PR feedback.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Spotless

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

---------

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
(cherry picked from commit 752da21)
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
normanj-bitquill pushed a commit that referenced this pull request Oct 25, 2024
…) (opensearch-project#2020)

* Add support for `date_nanos` and tests. (#337)

* Add support for `date_nanos` and tests.



* Add more IT.



---------



* Typo fix in IT.



* Address PR feedback.



* Spotless



---------


(cherry picked from commit 752da21)

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.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