-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-unit-tests |
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@XuHuaiyu Could you add a gofail test? |
Please add a test case. |
/run-unit-test |
1 similar comment
/run-unit-test |
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;") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A simple case to use hash aggregate is
select sum(a) from t group by b;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The case can also check whether the child of HashAgg is closed correctly, so I make a Projection there.
- 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to check the error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
Side effects
N/A
Related changes
release-2.1
This change is