zenoyang commented on code in PR #9969:
URL: https://github.com/apache/incubator-doris/pull/9969#discussion_r890971920


##########
be/src/olap/in_list_predicate.cpp:
##########
@@ -161,12 +162,14 @@ IN_LIST_PRED_COLUMN_BLOCK_EVALUATE(NotInListPredicate, ==)
                         
reinterpret_cast<vectorized::ColumnDictionary<vectorized::Int32>&>(      \
                                 column);                                       
                  \
                 auto& data_array = dict_col.get_data();                        
                  \
-                auto dict_codes = dict_col.find_codes(_values);                
                  \
+                std::vector<bool> selected;                                    
                  \
+                dict_col.find_codes(_values, selected);                        
                  \
                 for (uint16_t i = 0; i < *size; i++) {                         
                  \
                     uint16_t idx = sel[i];                                     
                  \
                     sel[new_size] = idx;                                       
                  \
                     const auto& cell_value = data_array[idx];                  
                  \
-                    auto result = (dict_codes.find(cell_value) OP 
dict_codes.end());             \
+                    assert(cell_value < selected.size());                      
                  \

Review Comment:
   Calling `assert` in a loop can affect performance. `selected.size()` is 
actually the size of the dict, and `cell_value` must be smaller than the size 
of the dict, which is guaranteed when writing, so I don't think there is any 
need to add an assertion.



-- 
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-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to