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

executor: refine HashAgg.Close when unparallelExec #8810

Merged
merged 10 commits into from Dec 27, 2018

Conversation

Projects
None yet
7 participants
@XuHuaiyu
Copy link
Contributor

XuHuaiyu commented Dec 25, 2018

What problem does this PR solve?

fix #8787

What is changed and how it works?

Close the child executor when HashAgg executes unparalleled.

Check List

Tests

exists leak tests

Code changes

  • Has exported function/method change

Side effects

N/A

Related changes

  • Need to cherry-pick to the release branch

release-2.1


This change is Reviewable

@eurekaka
Copy link
Contributor

eurekaka left a comment

LGTM

@eurekaka

This comment has been minimized.

Copy link
Contributor

eurekaka commented Dec 25, 2018

/run-unit-tests

@XuHuaiyu

This comment has been minimized.

Copy link
Contributor Author

XuHuaiyu commented Dec 25, 2018

/run-all-tests

@zz-jason
Copy link
Member

zz-jason left a comment

LGTM

@zz-jason zz-jason added status/LGT2 and removed status/LGT1 labels Dec 25, 2018

@zz-jason

This comment has been minimized.

Copy link
Member

zz-jason commented Dec 25, 2018

@XuHuaiyu Could you add a gofail test?

@shenli

This comment has been minimized.

Copy link
Member

shenli commented Dec 26, 2018

Please add a test case.

@crazycs520

This comment has been minimized.

Copy link
Contributor

crazycs520 commented Dec 27, 2018

/run-unit-test

1 similar comment
@eurekaka

This comment has been minimized.

Copy link
Contributor

eurekaka commented Dec 27, 2018

/run-unit-test

@XuHuaiyu

This comment has been minimized.

Copy link
Contributor Author

XuHuaiyu commented Dec 27, 2018

PTAL @zz-jason gofail test added

tk.MustExec(`drop table if exists t;`)
tk.MustExec("create table t(a int, b int)")
tk.MustExec("insert into t values(1,1),(2,2)")
result := tk.MustQuery("desc select sum(a) from (select cast(t.a as signed) as a, b from t) t group by b;")

This comment has been minimized.

Copy link
@zz-jason

zz-jason Dec 27, 2018

Member

A simple case to use hash aggregate is

select sum(a) from t group by b;

This comment has been minimized.

Copy link
@zz-jason

zz-jason Dec 27, 2018

Member

Do we really need this test case? If the planner hasn't chosen the Hash Aggregate operator, the following gofail test would not passed I think.

This comment has been minimized.

Copy link
@XuHuaiyu

XuHuaiyu Dec 27, 2018

Author Contributor
  1. The case can also check whether the child of HashAgg is closed correctly, so I make a Projection there.
  2. Yep, the explain result is not really needed, I'll make it as a comment.
rs := rss[0]
chk := rs.NewChunk()
err = rs.Next(ctx, chk)
c.Assert(err, NotNil)

This comment has been minimized.

Copy link
@zz-jason

zz-jason Dec 27, 2018

Member

It's better to check the error message

@zz-jason
Copy link
Member

zz-jason left a comment

LGTM

ngaut and others added some commits Dec 27, 2018

@XuHuaiyu XuHuaiyu merged commit 7108881 into pingcap:master Dec 27, 2018

3 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
ci/circleci Your tests passed on CircleCI!
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@XuHuaiyu XuHuaiyu deleted the XuHuaiyu:hashagg_close branch Dec 27, 2018

AndrewDi added a commit to AndrewDi/tidb that referenced this pull request Dec 28, 2018

lamxTyler added a commit to lamxTyler/tidb that referenced this pull request Jan 2, 2019

yu34po added a commit to yu34po/tidb that referenced this pull request Jan 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.