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/04/02 06:37:00 UTC

[GitHub] [incubator-doris] zenoyang commented on a change in pull request #8787: [fix](storage) Fix query result error due to find code by bound

zenoyang commented on a change in pull request #8787:
URL: https://github.com/apache/incubator-doris/pull/8787#discussion_r841025228



##########
File path: be/src/olap/comparison_predicate.cpp
##########
@@ -548,8 +547,7 @@ COMPARISON_PRED_SET_DICT_CODE(NotEqualPredicate)
                 auto& dict_col =                                                               \
                         reinterpret_cast<vectorized::ColumnDictionary<vectorized::Int32>&>(    \
                                 *col_ptr);                                                     \
-                auto code = dict_col.find_code_by_bound(_value, 0 OP 1, 1 OP 1);               \
-                _dict_code = code;                                                             \
+                _dict_code = dict_col.find_code_by_bound(_value, 1 OP 0, 1 OP 1);              \

Review comment:
       If `1 OP 0` returns true, it means the predicate is `>` or `>=`,
   If `1 OP 1` returns true, it means the predicate is `>=` or `<=`
   Through this trick, avoid redundant code, such as `bool is_greater = type() == PredicateType::GT || type() == PredicateType::GE;`
   ok, i will add a comment.




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