-
Notifications
You must be signed in to change notification settings - Fork 409
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
Test aggregation functions #5364
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/cc @ywqzzy /cc @Willendless |
@xzhangxian1008: GitHub didn't allow me to request PR reviews from the following users: /cc. Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
||
void executeWithConcurrency(const std::shared_ptr<tipb::DAGRequest> & request, const ColumnsWithTypeAndName & expect_columns) | ||
{ | ||
for (size_t i = 1; i < max_concurrency; i += step) |
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.
for (size_t i = 1; i < max_concurrency; i += step) | |
for (size_t i = 1; i <= max_concurrency; i += step) |
{ | ||
/// We can filter the group by column with project operator. | ||
/// topN is applied to get stable results in concurrency environment. | ||
return context.scan(db_name, table_name).aggregation(agg_funcs, group_by_exprs).topN(order_by_items, 100).project(proj).build(context); |
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.
maybe explain why we need a projection?
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.
maybe explain why we need a projection?
Done
/run-all-tests |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
{ | ||
ExecutorTest::initializeContext(); | ||
|
||
context.addMockTable({db_name, table_name}, |
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.
how about add /* parameter_name = */ {db_name, table_name}
in this case, otherwise it is confusing.
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.
Others LGTM
const String table_name{"clerk"}; | ||
const std::vector<String> col_name{"age", "gender", "country", "salary"}; | ||
ColumnWithNullableInt32 col_age{30, {}, 27, 32, 25, 36, {}, 22, 34}; | ||
ColumnWithNullableString col_gender{ |
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.
in one line?
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.
in one line?
It's clang-tidy who forces me to write like this.
std::shared_ptr<tipb::DAGRequest> buildDAGRequest(std::pair<String, String> src, MockAstVec agg_funcs, MockAstVec group_by_exprs, MockColumnNameVec proj) | ||
{ | ||
/// We can filter the group by column with project operator. | ||
/// project is applied to get single column for comparison |
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.
More comments of why use project, like “partial agg output group by columns"
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.
More comments of why use project, like “partial agg output group by columns"
Done
size_t max_concurrency = 10; | ||
size_t step = 2; |
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.
Maybe use static const
?
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.
Maybe use
static const
?
Get
/run-all-tests |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
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.
other LGTM
} | ||
CATCH | ||
|
||
// TODO more aggregation functions... |
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.
and add TODO more data types...
?
} | ||
CATCH | ||
|
||
TEST_F(ExecutorAggTestRunner, AggregationMaxAndMin) |
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.
add comment like TODO: support more type of min, max, count
?
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.
add comment like
TODO: support more type of min, max, count
?
okk
/merge |
@ywqzzy: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: c1a18c8
|
Co-authored-by: SeaRise <hhssearise@foxmail.com>
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
/run-all-tests |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
@xzhangxian1008: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
What problem does this PR solve?
Issue Number: ref #5347
Problem Summary:
What is changed and how it works?
Add some tests with different types to guarantee the correctness of group by.
Add some tests for the following aggregation functions:
Check List
Tests
Side effects
Documentation
Release note