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 StreamAggExec when child is empty #7002

Merged
merged 13 commits into from
Jul 11, 2018

Conversation

XuHuaiyu
Copy link
Contributor

@XuHuaiyu XuHuaiyu commented Jul 5, 2018

What have you changed? (mandatory)

This PR refines the StreamAgg process when ChildExec returns empty.
This processing logic can be used both in the old and new evaluation framework.

What are the type of the changes (mandatory)?

The currently defined types are listed below, please pick one of the types for this PR by removing the others:

  • Improvement (non-breaking change which is an improvement to an existing feature)

How has this PR been tested (mandatory)?

the existing tests

Does this PR affect documentation (docs/docs-cn) update? (optional)

no

Refer to a related PR or issue link (optional)

#6952

Benchmark result if necessary (optional)

Add a few positive/negative examples (optional)

@XuHuaiyu
Copy link
Contributor Author

XuHuaiyu commented Jul 5, 2018

PTAL @zz-jason @winoros

@zz-jason
Copy link
Member

zz-jason commented Jul 5, 2018

add a test that uses the new framework?

@zz-jason zz-jason added type/enhancement The issue or PR belongs to an enhancement. sig/execution SIG execution labels Jul 6, 2018
@zz-jason zz-jason added this to the 2.1 milestone Jul 6, 2018
@zz-jason
Copy link
Member

zz-jason commented Jul 6, 2018

/run-all-tests

@zz-jason
Copy link
Member

zz-jason commented Jul 6, 2018

LGTM

@XuHuaiyu
Copy link
Contributor Author

XuHuaiyu commented Jul 6, 2018

PTAL @winoros

@zz-jason
Copy link
Member

zz-jason commented Jul 6, 2018

@XuHuaiyu sqllogical test failed.

@winoros
Copy link
Member

winoros commented Jul 6, 2018

/run-common-test

return errors.Trace(err)
}
if !e.isChildReturnEmpty {
err = e.appendResult2Chunk(chk)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't check the value of err here? If you have any particular reason to do so, is it better you add it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

err is checked in line 892

Copy link
Contributor

Choose a reason for hiding this comment

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

got it.

@zz-jason
Copy link
Member

@XuHuaiyu any update?

@XuHuaiyu
Copy link
Contributor Author

/run-all-tests

1 similar comment
@XuHuaiyu
Copy link
Contributor Author

/run-all-tests

@zz-jason
Copy link
Member

/run-all-tests

// According to MySQL, DefaultValue of the aggregation function can be tested as the following sql:
//
// e.g.
// mysql> create table t(a int);
Copy link
Member

Choose a reason for hiding this comment

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

Can we simplify the comment? This format is not very formal 😂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I'll have a try

@XuHuaiyu
Copy link
Contributor Author

PTAL @zz-jason @winoros

// +------+--------+--------+----------+------------+-----------+----------------------+--------+--------+-----------------+
// | NULL | NULL | NULL | 0 | 0 | 0 | 18446744073709551615 | NULL | NULL | NULL |
// +------+--------+--------+----------+------------+-----------+----------------------+--------+--------+-----------------+
func (a *AggFuncDesc) GetDefaultValue() (v types.Datum) {
Copy link
Member

Choose a reason for hiding this comment

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

Can this function be moved to the Aggregation interface, it seems like belonging to the execution layer.

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

@XuHuaiyu
Copy link
Contributor Author

PTAL @winoros

Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

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

LGTM

@winoros winoros added the status/LGT2 Indicates that a PR has LGTM 2. label Jul 11, 2018
@XuHuaiyu XuHuaiyu merged commit ab46569 into pingcap:master Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants