-
Notifications
You must be signed in to change notification settings - Fork 410
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
max_block_size
take effect on NonJoinedBlockInputStream
#6663
max_block_size
take effect on NonJoinedBlockInputStream
#6663
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. |
rows_added += AdderNonJoined<STRICTNESS, typename Map::mapped_type>::add((*it)->getMapped(), key_num, num_columns_left, mutable_columns_left, num_columns_right, mutable_columns_right); | ||
|
||
if (rows_added >= max_block_size) | ||
if constexpr (STRICTNESS == ASTTableJoin::Strictness::Any) |
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 we can simplify this if statement to
rows_added += AdderNonJoined<STRICTNESS, typename Map::mapped_type>::add((*it)->getMapped(), key_num, num_columns_left, mutable_columns_left, num_columns_right, mutable_columns_right, current_index_in_row_list, STRICTNESS == ASTTableJoin::Strictness::Any ? 1 : max_block_size - rows_added);
assert(rows_added <= max_block_size);
if constexpr (STRICTNESS == ASTTableJoin::Strictness::Any)
{
++(*it);
}
else if(current_index_in_row_list == 0)
{
++(*it);
}
if (rows_added == max_block_size)
{
break;
}
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.
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.
Good point, refined the code.
11da41b
to
51fc619
Compare
for (auto current = &static_cast<const typename Mapped::Base_t &>(mapped); current != nullptr; current = current->next) | ||
auto current = &static_cast<const typename Mapped::Base_t &>(mapped); | ||
/// skip the added row | ||
for (size_t i = 0; i < next_index_in_row_list; i++, current = current->next) |
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 = 0; i < next_index_in_row_list; i++, current = current->next) | |
for (size_t i = 0; i < next_index_in_row_list; ++i, current = current->next) |
auto current = &static_cast<const typename Mapped::Base_t &>(mapped); | ||
/// skip the added row | ||
for (size_t i = 0; i < next_index_in_row_list; i++, current = current->next) | ||
{ | ||
assert(current != nullptr); | ||
} | ||
assert(current != nullptr); |
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.
Could it hold a pointer directly instead of index?
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
Signed-off-by: xufei <xufei@pingcap.com>
02f583b
to
1caebec
Compare
/merge |
@windtalker: 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: 1caebec
|
…6663) ref pingcap#3436 Signed-off-by: ywqzzy <592838129@qq.com>
What problem does this PR solve?
Issue Number: ref #3436
Problem Summary:
What is changed and how it works?
NonJoinedBlockInputStream
undermax_block_size
Check List
Tests
Side effects
Documentation
Release note