xiaokang commented on code in PR #10694:
URL: https://github.com/apache/doris/pull/10694#discussion_r931692373
##########
be/src/vec/olap/vcollect_iterator.cpp:
##########
@@ -34,14 +34,19 @@ VCollectIterator::~VCollectIterator() {}
}
\
} while (false)
-void VCollectIterator::init(TabletReader* reader) {
+void VCollectIterator::init(TabletReader* reader, bool force_merge, bool
is_reverse) {
_reader = reader;
// when aggregate is enabled or key_type is DUP_KEYS, we don't merge
// multiple data to aggregate for better performance
if (_reader->_reader_type == READER_QUERY &&
(_reader->_direct_mode || _reader->_tablet->keys_type() ==
KeysType::DUP_KEYS)) {
_merge = false;
}
+
+ if (force_merge) {
+ _merge = true;
+ }
Review Comment:
can not just set _merge = force_merge, since when force_merge == false there
is a chance _merge is already set to true before this statement.
##########
be/src/vec/olap/vgeneric_iterators.cpp:
##########
@@ -177,7 +178,7 @@ class VMergeIteratorContext {
if (_is_unique) {
result ? this->set_skip(true) : rhs.set_skip(true);
}
- return result;
+ return UNLIKELY(_is_reverse) ? !result : result;
Review Comment:
fixed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]