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

planner: fix wrong result when pushing Agg down through Union in MPP plans #46310

Merged
merged 6 commits into from
Aug 30, 2023

Conversation

AilinKid
Copy link
Contributor

@AilinKid AilinKid commented Aug 22, 2023

What problem does this PR solve?

Issue Number: close #45850

Problem Summary:

What is changed and how it works?

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

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

planner: fix wrong result when pushing Agg down through Union in MPP plans

Signed-off-by: AilinKid <314806019@qq.com>
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 22, 2023
@tiprow
Copy link

tiprow bot commented Aug 22, 2023

Hi @AilinKid. 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/test-infra repository.

@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Merging #46310 (a33f445) into master (a8cfe88) will increase coverage by 0.1158%.
Report is 79 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #46310        +/-   ##
================================================
+ Coverage   73.3559%   73.4717%   +0.1158%     
================================================
  Files          1284       1326        +42     
  Lines        393258     409466     +16208     
================================================
+ Hits         288478     300842     +12364     
- Misses        86416      90120      +3704     
- Partials      18364      18504       +140     
Flag Coverage Δ
integration 26.3725% <70.0000%> (?)
unit 74.1394% <100.0000%> (+0.7835%) ⬆️

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

Components Coverage Δ
dumpling 54.0444% <ø> (ø)
parser 85.1752% <ø> (+0.1084%) ⬆️
br 49.2369% <ø> (-3.0095%) ⬇️

Signed-off-by: AilinKid <314806019@qq.com>
Signed-off-by: AilinKid <314806019@qq.com>
@AilinKid
Copy link
Contributor Author

/test unit-test

@tiprow
Copy link

tiprow bot commented Aug 23, 2023

@AilinKid: 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/test-infra repository.

Signed-off-by: AilinKid <314806019@qq.com>
finalAggAdjust := func(aggFuncs []*aggregation.AggFuncDesc) {
for _, agg := range aggFuncs {
if agg.Mode == aggregation.FinalMode && agg.Name == ast.AggFuncCount {
agg.Name = ast.AggFuncSum
Copy link
Contributor

Choose a reason for hiding this comment

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

count() returns integer result type, does sum in TiFlash also return integer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

make sense, addressed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

by the way, sum(arg) should return the same type with its args, now its arg come from sub-split-count, so the return type should be the same

Signed-off-by: AilinKid <314806019@qq.com>
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. and removed do-not-merge/needs-triage-completed labels Aug 24, 2023
Signed-off-by: AilinKid <314806019@qq.com>
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 25, 2023
Copy link
Contributor

@fixdb fixdb left a comment

Choose a reason for hiding this comment

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

+1

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 25, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 30, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fixdb, qw4990

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 approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 30, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 30, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-08-25 21:06:40.669016758 +0000 UTC m=+1529165.218032730: ☑️ agreed by fixdb.
  • 2023-08-30 07:29:13.489130827 +0000 UTC m=+1912118.038146814: ☑️ agreed by qw4990.

@qw4990 qw4990 added the sig/planner SIG: Planner label Aug 30, 2023
@AilinKid AilinKid merged commit 4facc13 into pingcap:master Aug 30, 2023
14 of 16 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.1: #46515.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Aug 30, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #46516.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Aug 30, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #46517.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Aug 30, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-5.3: #46518.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Aug 30, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-5.4: #46519.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Aug 30, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot bot pushed a commit that referenced this pull request Oct 13, 2023
ti-chi-bot bot pushed a commit that referenced this pull request Oct 31, 2023
ti-chi-bot bot pushed a commit that referenced this pull request Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

planner: wrong result when pushing Agg down through Union in MPP plans
4 participants