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

plan, executor: add physical stream agg and remove aggType #5274

Merged
merged 11 commits into from
Dec 4, 2017

Conversation

hanfei1991
Copy link
Member

add stream agg operator
@zimulala

@hanfei1991
Copy link
Member Author

/run-all-tests tidb-test=pr/415

1 similar comment
@hanfei1991
Copy link
Member Author

/run-all-tests tidb-test=pr/415

@hanfei1991
Copy link
Member Author

/run-common-test tidb-test=pr/415

return &HashAggExec{
baseExecutor: newBaseExecutor(v.Schema(), b.ctx, b.build(v.Children()[0])),
sc: b.ctx.GetSessionVars().StmtCtx,
AggFuncs: v.AggFuncs,
GroupByItems: v.GroupByItems,
aggType: v.AggType,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove the field of aggType

agg := basePhysicalAgg{
GroupByItems: p.GroupByItems,
AggFuncs: p.AggFuncs,
}.initForStream(p.ctx, cols[:len(keys)], p.inputCount)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use keys directly?

@hanfei1991
Copy link
Member Author

/run-integration-common-test tidb-test=pr/415

1 similar comment
@hanfei1991
Copy link
Member Author

/run-integration-common-test tidb-test=pr/415

@hanfei1991
Copy link
Member Author

/run-common-test tidb-test=pr/415

@zimulala
Copy link
Contributor

zimulala commented Dec 1, 2017

LGTM

@zimulala zimulala added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 1, 2017
@coocood
Copy link
Member

coocood commented Dec 2, 2017

@hanfei1991
Any test covers it?

func (p *PhysicalAggregation) ExplainInfo() string {
buffer := bytes.NewBufferString(fmt.Sprintf("type:%s", p.AggType))
func (p *basePhysicalAgg) ExplainInfo() string {
buffer := bytes.NewBufferString("")
Copy link
Member

Choose a reason for hiding this comment

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

Why removes aggregation type?

@hanfei1991
Copy link
Member Author

@coocood This is just a refactor. Replace field 'aggType' with an individual operator PhysicalStreamAggregate. So no test needs to supply.

coocood
coocood previously approved these changes Dec 3, 2017
Copy link
Member

@coocood coocood left a comment

Choose a reason for hiding this comment

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

LGTM

@coocood
Copy link
Member

coocood commented Dec 3, 2017

@hanfei1991
So the title is misleading. Please change it.

@coocood
Copy link
Member

coocood commented Dec 3, 2017

/run-common-test tidb-test=pr/415

@hanfei1991 hanfei1991 changed the title plan, executor: implement physical stream agg plan, executor: add physical stream agg and remove aggType Dec 3, 2017

func (b *executorBuilder) buildStreamAgg(v *plan.PhysicalStreamAgg) Executor {
return &StreamAggExec{
baseExecutor: newBaseExecutor(v.Schema(), b.ctx, b.build(v.Children()[0])),
Copy link
Member

Choose a reason for hiding this comment

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

childExec := b.build(v.Children()[0])
if b.err != nil {
    b.err = errors.Trace(b.err)
    return nil
}

@hanfei1991
Copy link
Member Author

/run-common-test tidb-test=pr/415

@hanfei1991
Copy link
Member Author

/run-common-test tidb-test=pr/415

@hanfei1991
Copy link
Member Author

@zz-jason PTAL

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@hanfei1991
Copy link
Member Author

/run-common-test tidb-test=pr/415

@hanfei1991
Copy link
Member Author

/run-common-test tidb-test=pr/415

@hanfei1991 hanfei1991 merged commit e9a52b5 into pingcap:master Dec 4, 2017
@hanfei1991 hanfei1991 deleted the streamagg branch December 4, 2017 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants