Skip to content

Conversation

@Yury-Fridlyand
Copy link
Collaborator

Signed-off-by: Yury Fridlyand [email protected]

Description

  • maketime, references: one two
    • Supports any values in range 00:00:00.0 - 23:59:59.(9);
    • All arguments are double, but hour and minute are rounded (as MySQL works);
    • Fraction second part is kept;
    • NULL values causes NULL result;
    • Unlike MySQL, negative values, and hour > 23 are not supported. Implementation of that requires big changes.
  • makedate, references one two
    • All arguments are double, but rounded (as MySQL works);
    • Zero year interpreted as 2000 (as MySQL works);
    • NULL values causes NULL result;
    • day < 1 causes NULL result;
    • day > 365/366 causes switching to the next year.

Implementation details

Functions have 2 implementations:

  • easier
  • faster

I used easier one, but faster one used in unit tests. Could be swapped.

According to MySQL both functions accept double values. Arguments which are not supposed to have fraction parts (e.g. hour, year) are rounded.

maketime doesn't support range of +-838 hours, it is limited by 24 hour clock time. Implementation of that requires big changes.

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.

@Yury-Fridlyand Yury-Fridlyand requested a review from a team as a code owner August 12, 2022 18:55
@codecov-commenter
Copy link

codecov-commenter commented Aug 12, 2022

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.84%. Comparing base (deececb) to head (00a2dca).
⚠️ Report is 1057 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #755      +/-   ##
============================================
+ Coverage     94.83%   94.84%   +0.01%     
- Complexity     2898     2908      +10     
============================================
  Files           287      287              
  Lines          7803     7825      +22     
  Branches        568      571       +3     
============================================
+ Hits           7400     7422      +22     
  Misses          349      349              
  Partials         54       54              
Flag Coverage Δ
query-workbench 62.76% <ø> (ø)
sql-engine 97.79% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dai-chen
Copy link
Collaborator

Could you rebase your branch? There seems many irrelevant changes from previous commit. Thanks!

Signed-off-by: Yury Fridlyand <[email protected]>
@Yury-Fridlyand Yury-Fridlyand force-pushed the integ-make-time-n-date branch from 1b6877d to 00a2dca Compare August 12, 2022 22:01
@Yury-Fridlyand
Copy link
Collaborator Author

Could you rebase your branch? There seems many irrelevant changes from previous commit. Thanks!

Should be ok now.

Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

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

Thanks for the changes!

@dai-chen dai-chen merged commit 9f602c3 into opensearch-project:main Aug 16, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 17, 2022
Signed-off-by: Yury Fridlyand <[email protected]>

Signed-off-by: Yury Fridlyand <[email protected]>
(cherry picked from commit 9f602c3)
@Yury-Fridlyand Yury-Fridlyand deleted the integ-make-time-n-date branch September 9, 2022 21:12
@MaxKsyunz MaxKsyunz added enhancement New feature or request SQL PPL Piped processing language labels Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.x enhancement New feature or request PPL Piped processing language SQL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants