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

feat: implement shiftLeft function push down #5495

Merged
merged 6 commits into from
Aug 4, 2022

Conversation

AnnieoftheStars
Copy link
Contributor

@AnnieoftheStars AnnieoftheStars commented Jul 28, 2022

What problem does this PR solve?

Issue Number: close #5099

related pr: pingcap/tidb#36677

Problem Summary:

implement shiftLeft function push down

What is changed and how it works?

  1. Register bitShiftLeft func name in scalar_func_map.
  2. update DAGExpressionAnalyzerHelper::function_builder_map, wrap bitShiftLeft builder with buildBitwiseFunction.
  3. Referring to shiftRight implementation and cppRef, update original BitShiftRightImpl to handle a C++ undefined behavior of shift operation.

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 shiftLeft to TiFlash

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 28, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • SeaRise
  • wshwsh12

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 do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. labels Jul 28, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Jul 28, 2022

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jul 28, 2022
@ti-chi-bot
Copy link
Member

Welcome @AnnieoftheStars!

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. 😃

@AnnieoftheStars
Copy link
Contributor Author

/cc @Willendless Please take a look

@ti-chi-bot
Copy link
Member

@AnnieoftheStars: GitHub didn't allow me to request PR reviews from the following users: Please, take, a, look.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @Willendless Please take a look

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 kubernetes/test-infra repository.

@AnnieoftheStars AnnieoftheStars changed the title feat: implement shiftRight function push down feat: implement shiftLeft function push down Jul 28, 2022
@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. labels Jul 28, 2022
@AnnieoftheStars
Copy link
Contributor Author

/cc @zanmato1984 @guo-shaoge

@AnnieoftheStars
Copy link
Contributor Author

/retest

@Willendless
Copy link
Contributor

Willendless commented Jul 28, 2022

Thanks for your contribution, excellent job! 🥳

@Willendless
Copy link
Contributor

According to https://github.com/pingcap/tiflash#contributing, you can try

cd $WORKSPACE/tiflash
python3 format-diff.py --diff_from `git merge-base ${TARGET_REMOTE_BRANCH} HEAD`

to format your code :)

@Willendless
Copy link
Contributor

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Jul 28, 2022

Coverage for changed files

Filename                                              Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Flash/Coprocessor/DAGExpressionAnalyzerHelper.cpp          92                44    52.17%          14                 3    78.57%         244                96    60.66%          68                39    42.65%
Flash/Coprocessor/DAGUtils.cpp                            347               141    59.37%          45                11    75.56%         638               271    57.52%         412               190    53.88%
Functions/bitShiftLeft.cpp                                  5                 0   100.00%           2                 0   100.00%          10                 0   100.00%           2                 0   100.00%
Functions/tests/gtest_bitshiftleft.cpp                    357                49    86.27%           7                 0   100.00%         153                 0   100.00%          28                28     0.00%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                     801               234    70.79%          68                14    79.41%        1045               367    64.88%         510               257    49.61%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18875      9437             50.00%    215184  95374        55.68%

full coverage report (for internal network access only)

@AnnieoftheStars
Copy link
Contributor Author

According to https://github.com/pingcap/tiflash#contributing, you can try

cd $WORKSPACE/tiflash
python3 format-diff.py --diff_from `git merge-base ${TARGET_REMOTE_BRANCH} HEAD`

to format your code :)

okay.

@Willendless
Copy link
Contributor

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Jul 29, 2022

Coverage for changed files

Filename                                              Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Flash/Coprocessor/DAGExpressionAnalyzerHelper.cpp          92                44    52.17%          14                 3    78.57%         244                96    60.66%          68                39    42.65%
Flash/Coprocessor/DAGUtils.cpp                            347               141    59.37%          45                11    75.56%         638               271    57.52%         412               190    53.88%
Functions/bitShiftLeft.cpp                                  5                 0   100.00%           2                 0   100.00%          10                 0   100.00%           2                 0   100.00%
Functions/tests/gtest_bitshiftleft.cpp                    357                49    86.27%           7                 0   100.00%         153                 0   100.00%          28                28     0.00%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                     801               234    70.79%          68                14    79.41%        1045               367    64.88%         510               257    49.61%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18875      9438             50.00%    215184  95395        55.67%

full coverage report (for internal network access only)

@Willendless
Copy link
Contributor

Willendless commented Jul 29, 2022

LGTM

@ti-chi-bot
Copy link
Member

@Willendless: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

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 ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 1, 2022
Copy link
Contributor

@SeaRise SeaRise 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 3, 2022
@SeaRise
Copy link
Contributor

SeaRise commented Aug 4, 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: 32f827c

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

sre-bot commented Aug 4, 2022

Coverage for changed files

Filename                                              Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Flash/Coprocessor/DAGExpressionAnalyzerHelper.cpp          92                44    52.17%          14                 3    78.57%         244                96    60.66%          68                39    42.65%
Flash/Coprocessor/DAGUtils.cpp                            347               135    61.10%          45                 7    84.44%         638               257    59.72%         412               188    54.37%
Functions/bitShiftLeft.cpp                                  5                 0   100.00%           2                 0   100.00%          10                 0   100.00%           2                 0   100.00%
Functions/tests/gtest_bitshiftleft.cpp                    357                49    86.27%           7                 0   100.00%         153                 0   100.00%          28                28     0.00%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                     801               228    71.54%          68                10    85.29%        1045               353    66.22%         510               255    50.00%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
19022      9231             51.47%    215506  93988        56.39%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit e17ef39 into pingcap:master Aug 4, 2022
@AnnieoftheStars AnnieoftheStars deleted the issue-5009 branch August 5, 2022 09:02
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/XL Denotes a PR that changes 500-999 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.

Implement LeftShift function push down
6 participants