This is an automated email from the ASF dual-hosted git repository.
lichaoyong 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 d5e456a [BUG] Fix except wrong answer bug (#4369)
d5e456a is described below
commit d5e456a3c32aaaf29b3315cf92fefcd7a52b06e0
Author: lichaoyong <[email protected]>
AuthorDate: Tue Aug 18 09:23:48 2020 +0800
[BUG] Fix except wrong answer bug (#4369)
Doris use HashTable to implement except.
If user send A except B except C, first do A except B and then except C.
After A except B, HashTable will be rebuild.
There is a bug here to throw some rows.
---
be/src/exec/except_node.cpp | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/be/src/exec/except_node.cpp b/be/src/exec/except_node.cpp
index 1411647..237b9b2 100644
--- a/be/src/exec/except_node.cpp
+++ b/be/src/exec/except_node.cpp
@@ -56,16 +56,12 @@ Status ExceptNode::open(RuntimeState* state) {
new HashTable(_child_expr_lists[0], _child_expr_lists[i],
_build_tuple_size,
true, _find_nulls, id(), mem_tracker(),
1024));
_hash_tbl_iterator = _hash_tbl->begin();
- uint32_t previous_hash = -1;
while (_hash_tbl_iterator.has_next()) {
- if (previous_hash != _hash_tbl_iterator.get_hash()) {
- previous_hash = _hash_tbl_iterator.get_hash();
- if (!_hash_tbl_iterator.matched()) {
- VLOG_ROW << "rebuild row: "
- <<
get_row_output_string(_hash_tbl_iterator.get_row(),
-
child(0)->row_desc());
- temp_tbl->insert(_hash_tbl_iterator.get_row());
- }
+ if (!_hash_tbl_iterator.matched()) {
+ VLOG_ROW << "rebuild row: "
+ <<
get_row_output_string(_hash_tbl_iterator.get_row(),
+ child(0)->row_desc());
+ temp_tbl->insert(_hash_tbl_iterator.get_row());
}
_hash_tbl_iterator.next<false>();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]