liaoxin01 commented on code in PR #14822:
URL: https://github.com/apache/doris/pull/14822#discussion_r1042083010


##########
be/src/olap/generic_iterators.cpp:
##########
@@ -266,9 +266,17 @@ class MergeIterator : public RowwiseIterator {
             // here we sort segment id in reverse order, because of the row 
order in AGG_KEYS
             // dose no matter, but in UNIQUE_KEYS table we only read the 
latest is one, so we
             // return the row in reverse order of segment id
-            bool result = res == 0 ? lhs->data_id() < rhs->data_id() : res < 0;
-            if (_is_unique) {
-                result ? lhs->set_skip(true) : rhs->set_skip(true);
+            bool result = false;

Review Comment:
   Please add some comments.
   The following method may be clearer.
   ```
    if (_is_unique) {
        bool result = res == 0 ? lhs->data_id() < rhs->data_id() : res < 0;
        result ? lhs->set_skip(true) : rhs->set_skip(true);
        return result;
    }     
    return lhs->data_id() > rhs->data_id();
   ```
   
   



-- 
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]

Reply via email to