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 request data type when pushing down avg aggfuncs #12051

Merged
merged 3 commits into from
Sep 6, 2019

Conversation

wshwsh12
Copy link
Contributor

@wshwsh12 wshwsh12 commented Sep 5, 2019

What problem does this PR solve?

When runing two avg() in one sql, the request types of aggfuncs in DAGRequest maybe wrong. (Now tikv can work well, because of it has type deduction and ignore the wrong infomation.)

What is changed and how it works?

Add a cursor to choose the right schema column.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

@wshwsh12 wshwsh12 added type/bugfix This PR fixes a bug. sig/planner SIG: Planner labels Sep 5, 2019
@codecov
Copy link

codecov bot commented Sep 5, 2019

Codecov Report

Merging #12051 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #12051   +/-   ##
===========================================
  Coverage   81.5418%   81.5418%           
===========================================
  Files           447        447           
  Lines         95990      95990           
===========================================
  Hits          78272      78272           
  Misses        12162      12162           
  Partials       5556       5556

@winoros
Copy link
Member

winoros commented Sep 5, 2019

Is it hard to add unit test?

@wshwsh12
Copy link
Contributor Author

wshwsh12 commented Sep 5, 2019

Is it hard to add unit test?

Yes, I don't know how to add unit test. Any idea?

@XuHuaiyu
Copy link
Contributor

XuHuaiyu commented Sep 6, 2019

We can build the plan refer to this.
Then iterate the plan tree and fetch the aggregation operator.

@wshwsh12
Copy link
Contributor Author

wshwsh12 commented Sep 6, 2019

/run-all-tests

@wshwsh12
Copy link
Contributor Author

wshwsh12 commented Sep 6, 2019

/run-unit-test

@wshwsh12
Copy link
Contributor Author

wshwsh12 commented Sep 6, 2019

I add unit test . PTAL @zz-jason @winoros @lzmhhh123

Copy link
Contributor

@lzmhhh123 lzmhhh123 left a comment

Choose a reason for hiding this comment

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

LGTM.

@lzmhhh123 lzmhhh123 added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 6, 2019
Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

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

LGTM

@XuHuaiyu XuHuaiyu added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 6, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Sep 6, 2019

/run-all-tests

@sre-bot sre-bot merged commit b0a6481 into pingcap:master Sep 6, 2019
@wshwsh12 wshwsh12 deleted the fix_split_avg branch April 21, 2020 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants