You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/07 11:19:49 UTC

[GitHub] [doris] liaoxin01 commented on a diff in pull request #14822: [fix](aggregate) agg table and unique table get different result when…

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