You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "jacktengg (via GitHub)" <gi...@apache.org> on 2023/02/03 09:01:20 UTC
[GitHub] [doris] jacktengg opened a new pull request, #16402: [fix](hashjoin) join produce blocks with rows larger than batch size: handle join with other conjuncts
jacktengg opened a new pull request, #16402:
URL: https://github.com/apache/doris/pull/16402
# Proposed changes
Related to pr #16166, handle hash join with other conjuncts.
## Problem summary
Describe your changes.
## Checklist(Required)
1. Does it affect the original behavior:
- [ ] Yes
- [ ] No
- [ ] I don't know
2. Has unit tests been added:
- [ ] Yes
- [ ] No
- [ ] No Need
3. Has document been added or modified:
- [ ] Yes
- [ ] No
- [ ] No Need
4. Does it need to update dependencies:
- [ ] Yes
- [ ] No
5. Are there any changes that cannot be rolled back:
- [ ] Yes (If Yes, please explain WHY)
- [ ] No
## Further comments
If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] Gabriel39 commented on a diff in pull request #16402: [fix](hashjoin) join produce blocks with rows larger than batch size: handle join with other conjuncts
Posted by "Gabriel39 (via GitHub)" <gi...@apache.org>.
Gabriel39 commented on code in PR #16402:
URL: https://github.com/apache/doris/pull/16402#discussion_r1099672507
##########
be/src/vec/exec/join/process_hash_table_probe_impl.h:
##########
@@ -462,95 +463,162 @@ Status ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts(
bool all_match_one = true;
int last_probe_index = probe_index;
- while (probe_index < probe_rows) {
- // ignore null rows
- if constexpr (ignore_null && need_null_map_for_probe) {
- if ((*null_map)[probe_index]) {
- if constexpr (probe_all) {
- _items_counts[probe_index++] = (uint32_t)1;
- same_to_prev.emplace_back(false);
- visited_map.emplace_back(nullptr);
- // only full outer / left outer need insert the data of right table
- if (LIKELY(current_offset < _build_block_rows.size())) {
- _build_block_offsets[current_offset] = -1;
- _build_block_rows[current_offset] = -1;
- } else {
- _build_block_offsets.emplace_back(-1);
- _build_block_rows.emplace_back(-1);
- }
- ++current_offset;
- } else {
- _items_counts[probe_index++] = (uint32_t)0;
- }
- all_match_one = false;
- continue;
+
+ int row_count_from_last_probe = 0;
+ bool is_the_last_sub_block = false;
+ size_t probe_size = 0;
+ auto& probe_row_match_iter =
+ std::get<ForwardIterator<Mapped>>(_join_node->_probe_row_match_iter);
+ if (probe_row_match_iter.ok()) {
+ auto origin_offset = current_offset;
+ for (; probe_row_match_iter.ok() && current_offset < _batch_size;
+ ++probe_row_match_iter) {
+ if (LIKELY(current_offset < _build_block_rows.size())) {
+ _build_block_offsets[current_offset] = probe_row_match_iter->block_offset;
+ _build_block_rows[current_offset] = probe_row_match_iter->row_num;
+ } else {
+ _build_block_offsets.emplace_back(probe_row_match_iter->block_offset);
+ _build_block_rows.emplace_back(probe_row_match_iter->row_num);
}
+ ++current_offset;
+ visited_map.emplace_back(&probe_row_match_iter->visited);
+ }
+ same_to_prev.emplace_back(false);
Review Comment:
is this always false needed to be emplace_back?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #16402: [fix](hashjoin) join produce blocks with rows larger than batch size: handle join with other conjuncts
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16402:
URL: https://github.com/apache/doris/pull/16402#issuecomment-1421953750
PR approved by at least one committer and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] hello-stephen commented on pull request #16402: [fix](hashjoin) join produce blocks with rows larger than batch size: handle join with other conjuncts
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #16402:
URL: https://github.com/apache/doris/pull/16402#issuecomment-1415797679
TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 34.73 seconds
load time: 489 seconds
storage size: 17170908125 Bytes
https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230203121928_clickbench_pr_90173.html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on a diff in pull request #16402: [fix](hashjoin) join produce blocks with rows larger than batch size: handle join with other conjuncts
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #16402:
URL: https://github.com/apache/doris/pull/16402#discussion_r1095519673
##########
be/src/vec/exec/join/process_hash_table_probe_impl.h:
##########
@@ -754,6 +937,42 @@ Status ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts(
}
}
+// For left or full outer join with other conjuncts.
+// If multiple equal-conjuncts-matched tuples is splitted into several
+// sub blocks, just filter out all the other-conjuncts-NOT-matched tuples at first,
+// and when processing the last sub block, check whether there are any
+// equal-conjuncts-matched tuple is output in all sub blocks,
+// if not, just pick a tuple and output.
+template <int JoinOpType>
+void ProcessHashTableProbe<JoinOpType>::_process_splited_equal_matched_tuples(
+ int start_row_idx, int row_count, const ColumnPtr& other_hit_column,
+ std::vector<bool*>& visited_map, int right_col_idx, int right_col_len,
+ UInt8* __restrict null_map_data, UInt8* __restrict filter_map, Block* output_block) {
+ int end_row_idx = start_row_idx + row_count;
+ for (int i = start_row_idx; i < end_row_idx; ++i) {
+ auto join_hit = visited_map[i] != nullptr;
+ auto other_hit = other_hit_column->get_bool(i);
+
+ if (!other_hit) {
+ for (size_t j = 0; j < right_col_len; ++j) {
+ typeid_cast<ColumnNullable*>(
+ std::move(*output_block->get_by_position(j + right_col_idx).column)
Review Comment:
warning: std::move of the const expression has no effect; remove std::move() [performance-move-const-arg]
```suggestion
*output_block->get_by_position(j + right_col_idx).column
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] Gabriel39 merged pull request #16402: [fix](hashjoin) join produce blocks with rows larger than batch size: handle join with other conjuncts
Posted by "Gabriel39 (via GitHub)" <gi...@apache.org>.
Gabriel39 merged PR #16402:
URL: https://github.com/apache/doris/pull/16402
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on a diff in pull request #16402: [fix](hashjoin) join produce blocks with rows larger than batch size: handle join with other conjuncts
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #16402:
URL: https://github.com/apache/doris/pull/16402#discussion_r1098133140
##########
be/src/vec/exec/join/process_hash_table_probe_impl.h:
##########
@@ -766,6 +988,42 @@ Status ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts(
}
}
+// For left or full outer join with other conjuncts.
+// If multiple equal-conjuncts-matched tuples is splitted into several
+// sub blocks, just filter out all the other-conjuncts-NOT-matched tuples at first,
+// and when processing the last sub block, check whether there are any
+// equal-conjuncts-matched tuple is output in all sub blocks,
+// if not, just pick a tuple and output.
+template <int JoinOpType>
+void ProcessHashTableProbe<JoinOpType>::_process_splited_equal_matched_tuples(
+ int start_row_idx, int row_count, const ColumnPtr& other_hit_column,
+ std::vector<bool*>& visited_map, int right_col_idx, int right_col_len,
+ UInt8* __restrict null_map_data, UInt8* __restrict filter_map, Block* output_block) {
+ int end_row_idx = start_row_idx + row_count;
+ for (int i = start_row_idx; i < end_row_idx; ++i) {
+ auto join_hit = visited_map[i] != nullptr;
+ auto other_hit = other_hit_column->get_bool(i);
+
+ if (!other_hit) {
+ for (size_t j = 0; j < right_col_len; ++j) {
+ typeid_cast<ColumnNullable*>(
+ std::move(*output_block->get_by_position(j + right_col_idx).column)
+ .assume_mutable()
Review Comment:
warning: std::move of the const expression has no effect; remove std::move() [performance-move-const-arg]
```suggestion
*output_block->get_by_position(j + right_col_idx).column
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #16402: [fix](hashjoin) join produce blocks with rows larger than batch size: handle join with other conjuncts
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16402:
URL: https://github.com/apache/doris/pull/16402#issuecomment-1421953773
PR approved by anyone and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org