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 panic of aggregation distinct function when distinct_agg… #26386

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zoomxi
Copy link
Contributor

@zoomxi zoomxi commented Jul 20, 2021

What problem does this PR solve?

Issue Number: close #24449

Problem Summary:

  • when tidb_opt_distinct_agg_push_down and tidb_enable_cascades_planner are open, if agg are Partially pushed down, the InjectProjectionBelowAgg will not be matched, so the groupExpr will be wrong.

What is changed and how it works?

What's Changed:

  • logical_plans.go
  • transformation_rules.go

How it Works:

  • update IsCompleteModeAgg to find if any of aggFuncs are CompleteMode, not just compare the first aggFunc
  • if aggFunc input is from 'partial data', no need to wrap cast for agg args

Check List

Tests

  • [*] Unit test
  • [*] Manual test (add detailed scripts or steps below)

Release note

  • No release note

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 20, 2021
@zoomxi
Copy link
Contributor Author

zoomxi commented Jul 20, 2021

/cc @tisonkun @eurekaka @winoros @SunRunAway @qw4990 @time-and-fate @zhouqiang-cl please have a code review, thanks

@ichn-hu ichn-hu mentioned this pull request Jul 20, 2021
@ti-chi-bot
Copy link
Member

@zoomxi: PR needs rebase.

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.

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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.

Aggregation distinct function panic when distinct_agg_push_down and enable_cascades_planner
2 participants