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

expression: Disallow conv fuction with hybrid type argement to be pushed down to TiKV #53502

Merged
merged 3 commits into from
May 23, 2024

Conversation

yibin87
Copy link
Contributor

@yibin87 yibin87 commented May 23, 2024

What problem does this PR solve?

Issue Number: close #51877

Problem Summary:

What changed and how does it work?

As described in #51877, such case can't be supported in TiKV side, just disallow it to be pushed down.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

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

Please refer to Release Notes Language Style Guide to write a quality release note.

None

…TiKV

Signed-off-by: yibin <huyibin@pingcap.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 23, 2024
Copy link

tiprow bot commented May 23, 2024

Hi @yibin87. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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-sigs/prow repository.

@yibin87
Copy link
Contributor Author

yibin87 commented May 23, 2024

/cc @windtalker @xzhangxian1008

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can test pushdown with integration test like this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice suggestion. For this case, the push down check is very simple and straightforward, I think the expr_to_pb_test can cover the functionality alread.

Copy link

codecov bot commented May 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.6281%. Comparing base (fe5858b) to head (b1f584b).
Report is 4 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53502        +/-   ##
================================================
+ Coverage   72.5209%   74.6281%   +2.1072%     
================================================
  Files          1505       1505                
  Lines        429883     430516       +633     
================================================
+ Hits         311755     321286      +9531     
+ Misses        98840      89334      -9506     
- Partials      19288      19896       +608     
Flag Coverage Δ
integration 49.4347% <12.5000%> (?)
unit 71.3285% <100.0000%> (-0.0794%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 50.4198% <ø> (+9.0157%) ⬆️

@yibin87
Copy link
Contributor Author

yibin87 commented May 23, 2024

/test check-dev2

Copy link

tiprow bot commented May 23, 2024

@yibin87: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test check-dev2

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-sigs/prow repository.

@yibin87
Copy link
Contributor Author

yibin87 commented May 23, 2024

/test unit-test

Copy link

tiprow bot commented May 23, 2024

@yibin87: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test unit-test

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-sigs/prow repository.

@yibin87
Copy link
Contributor Author

yibin87 commented May 23, 2024

/test check-dev2

Copy link

tiprow bot commented May 23, 2024

@yibin87: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test check-dev2

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-sigs/prow repository.

@yibin87
Copy link
Contributor Author

yibin87 commented May 23, 2024

/test unit-test

Copy link

tiprow bot commented May 23, 2024

@yibin87: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test unit-test

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-sigs/prow repository.

arg0 := sf.GetArgs()[0]
// To be aligned with MySQL, tidb handles hybrid type argument specially, tikv can't be consistent with tidb now.
if f, ok := arg0.(*ScalarFunction); ok {
if f.FuncName.L == ast.Cast && f.GetArgs()[0].GetType().Hybrid() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't need to check IsBinaryLiteral(f.GetArgs()[0]) here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not quite sure if constant folding may not take effect. Added for safety.

Signed-off-by: yibin <huyibin@pingcap.com>
Signed-off-by: yibin <huyibin@pingcap.com>
@yibin87 yibin87 requested a review from windtalker May 23, 2024 06:04
@yibin87
Copy link
Contributor Author

yibin87 commented May 23, 2024

/test unit-test

Copy link

tiprow bot commented May 23, 2024

@yibin87: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test unit-test

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-sigs/prow repository.

Copy link
Contributor

@windtalker windtalker 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 bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 23, 2024
Copy link
Contributor

@xzhangxian1008 xzhangxian1008 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented May 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: windtalker, xzhangxian1008

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 23, 2024
Copy link

ti-chi-bot bot commented May 23, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-23 07:14:18.237739811 +0000 UTC m=+2328611.994875384: ☑️ agreed by windtalker.
  • 2024-05-23 09:15:27.784212934 +0000 UTC m=+2335881.541348509: ☑️ agreed by xzhangxian1008.

Copy link

tiprow bot commented May 23, 2024

@yibin87: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow b1f584b link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

@ti-chi-bot ti-chi-bot bot merged commit c973157 into pingcap:master May 23, 2024
22 of 23 checks passed
RidRisR pushed a commit to RidRisR/tidb that referenced this pull request May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tikv conv function inconsistent results with tidb
3 participants