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

support CastTimeAsDuration in TiFlash #5548

Merged
merged 23 commits into from
Aug 15, 2022
Merged

support CastTimeAsDuration in TiFlash #5548

merged 23 commits into from
Aug 15, 2022

Conversation

AntiTopQuark
Copy link
Contributor

@AntiTopQuark AntiTopQuark commented Aug 6, 2022

What problem does this PR solve?

Issue Number: close #5306
related pr:pingcap/tidb#37036

Problem Summary:
support CastTimeAsDuration in TiFlash

What is changed and how it works?

  1. register the cast function
  2. implement the calculation for casting time to duration
  3. add tests of conversion

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Support to pushdown CastTimeAsDuration to TiFlash

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 6, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • SeaRise
  • ywqzzy

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Aug 6, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Aug 6, 2022

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 6, 2022
@ti-chi-bot
Copy link
Member

Welcome @AntiTopQuark!

It looks like this is your first PR to pingcap/tiflash 🎉.

I'm the bot to help you request reviewers, add labels and more, See available commands.

We want to make sure your contribution gets all the attention it needs!



Thank you, and welcome to pingcap/tiflash. 😃

@AntiTopQuark
Copy link
Contributor Author

/retest

@AntiTopQuark
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Aug 6, 2022

Coverage for changed files

Filename                                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Flash/Coprocessor/DAGUtils.cpp                    347               135    61.10%          45                 7    84.44%         638               257    59.72%         412               188    54.37%
Functions/FunctionsTiDBConversion.h               862               398    53.83%          88                20    77.27%        1971               556    71.79%         494               297    39.88%
Functions/tests/gtest_tidb_conversion.cpp         537               115    78.58%          38                 0   100.00%        1503                 0   100.00%          74                64    13.51%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                            1746               648    62.89%         171                27    84.21%        4112               813    80.23%         980               549    43.98%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
19020      9231             51.47%    215579  94015        56.39%

full coverage report (for internal network access only)

@AntiTopQuark
Copy link
Contributor Author

/cc @CalvinNeo

@AntiTopQuark
Copy link
Contributor Author

/cc @JaySon-Huang

@ywqzzy ywqzzy self-requested a review August 9, 2022 02:39
1. Split the date and time types
2. Add some comments
1. use checkAndGetDataType to get from_type
1. add null values into fullstack-test
2. add const and null test cases into unittest
@AntiTopQuark
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Aug 11, 2022

Coverage for changed files

Filename                                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Flash/Coprocessor/DAGUtils.cpp                    347               135    61.10%          45                 7    84.44%         638               257    59.72%         412               188    54.37%
Functions/FunctionsTiDBConversion.h               857               395    53.91%          87                20    77.01%        1950               557    71.44%         494               295    40.28%
Functions/tests/gtest_tidb_conversion.cpp         558               115    79.39%          38                 0   100.00%        1552                 0   100.00%          74                64    13.51%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                            1762               645    63.39%         170                27    84.12%        4140               814    80.34%         980               547    44.18%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
19248      9236             52.02%    218945  93946        57.09%

full coverage report (for internal network access only)

@AntiTopQuark
Copy link
Contributor Author

/cc @ywqzzy

@AntiTopQuark
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Aug 12, 2022

Coverage for changed files

Filename                                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Flash/Coprocessor/DAGUtils.cpp                    347               135    61.10%          45                 7    84.44%         638               257    59.72%         412               188    54.37%
Functions/FunctionsTiDBConversion.h               857               393    54.14%          87                20    77.01%        1944               553    71.55%         494               292    40.89%
Functions/tests/gtest_tidb_conversion.cpp         558               115    79.39%          38                 0   100.00%        1552                 0   100.00%          74                64    13.51%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                            1762               643    63.51%         170                27    84.12%        4134               810    80.41%         980               544    44.49%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
19256      9242             52.00%    219070  94024        57.08%

full coverage report (for internal network access only)

@AntiTopQuark
Copy link
Contributor Author

/cc @ywqzzy

@AntiTopQuark
Copy link
Contributor Author

/cc @Willendless

Copy link
Contributor

@ywqzzy ywqzzy left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 15, 2022
@SeaRise
Copy link
Contributor

SeaRise commented Aug 15, 2022

/merge

@ti-chi-bot
Copy link
Member

@SeaRise: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 003009a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 15, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Aug 15, 2022

Coverage for changed files

Filename                                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Flash/Coprocessor/DAGUtils.cpp                    347               135    61.10%          45                 7    84.44%         638               257    59.72%         412               188    54.37%
Functions/FunctionsTiDBConversion.h               857               395    53.91%          87                20    77.01%        1944               557    71.35%         494               295    40.28%
Functions/tests/gtest_tidb_conversion.cpp         558               115    79.39%          38                 0   100.00%        1552                 0   100.00%          74                64    13.51%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                            1762               645    63.39%         170                27    84.12%        4134               814    80.31%         980               547    44.18%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
19256      9242             52.00%    219070  93994        57.09%

full coverage report (for internal network access only)

@ti-chi-bot
Copy link
Member

@AntiTopQuark: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@sre-bot
Copy link
Collaborator

sre-bot commented Aug 15, 2022

Coverage for changed files

Filename                                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Flash/Coprocessor/DAGUtils.cpp                    347               135    61.10%          45                 7    84.44%         638               257    59.72%         412               188    54.37%
Functions/FunctionsTiDBConversion.h               857               396    53.79%          87                20    77.01%        1944               560    71.19%         494               296    40.08%
Functions/tests/gtest_tidb_conversion.cpp         558               115    79.39%          38                 0   100.00%        1552                 0   100.00%          74                64    13.51%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                            1762               646    63.34%         170                27    84.12%        4134               817    80.24%         980               548    44.08%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
19257      9243             52.00%    219073  94037        57.08%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit 577aada into pingcap:master Aug 15, 2022
@ti-chi-bot ti-chi-bot removed the request for review from Willendless February 8, 2023 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support CastTimeAsDuration in TiFlash
6 participants