This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push: new 3519a4f [BUG] Fix Left Semi Join Got a Wrong Result (#6379) 3519a4f is described below commit 3519a4ff476804775cefe99f89a91f4a3f9a531b Author: stdpain <34912776+stdp...@users.noreply.github.com> AuthorDate: Sat Aug 7 21:33:44 2021 +0800 [BUG] Fix Left Semi Join Got a Wrong Result (#6379) ``` SELECT count(distinct products_id) FROM a_table as a WHERE 1=1 AND products_id in ( SELECT products_id from b_table ); ``` Because hash table construction errors may lead to unstable results --- be/src/exec/hash_table.hpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/be/src/exec/hash_table.hpp b/be/src/exec/hash_table.hpp index 2e655ff..4b679c7 100644 --- a/be/src/exec/hash_table.hpp +++ b/be/src/exec/hash_table.hpp @@ -23,6 +23,13 @@ namespace doris { inline bool HashTable::emplace_key(TupleRow* row, TupleRow** dest_addr) { + if (_num_filled_buckets > _num_buckets_till_resize) { + resize_buckets(_num_buckets * 2); + } + if (_current_used == _current_capacity) { + grow_node_array(); + } + bool has_nulls = eval_build_row(row); if (!_stores_nulls && has_nulls) { @@ -52,14 +59,6 @@ inline bool HashTable::emplace_key(TupleRow* row, TupleRow** dest_addr) { node = last_node; } if (will_insert) { - if (_num_filled_buckets > _num_buckets_till_resize) { - resize_buckets(_num_buckets * 2); - // real bucket_id will modify after resize buckets - bucket_idx = hash & (_num_buckets - 1); - } - if (_current_used == _current_capacity) { - grow_node_array(); - } Node* alloc_node = reinterpret_cast<Node*>(_current_nodes + _node_byte_size * _current_used++); ++_num_nodes; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org