github-actions[bot] commented on code in PR #62841:
URL: https://github.com/apache/doris/pull/62841#discussion_r3160519673


##########
be/src/exprs/function/function_bitmap.cpp:
##########
@@ -942,28 +912,19 @@ struct BitmapHasAll {
     static void vector_vector(const TData& lvec, const TData& rvec, ResTData& 
res) {
         size_t size = lvec.size();
         for (size_t i = 0; i < size; ++i) {
-            uint64_t lhs_cardinality = lvec[i].cardinality();
-            auto bitmap = lvec[i];
-            bitmap |= rvec[i];
-            res[i] = bitmap.cardinality() == lhs_cardinality;
+            res[i] = lvec[i].contains_all(rvec[i]);
         }

Review Comment:
   This fast path changes `bitmap_has_all` results for mixed representations. 
`contains_all()` returns `false` whenever `rhs` is `BITMAP` and `lhs` is 
`SINGLE` or `SET`, but the previous implementation checked whether `lhs | rhs` 
kept the same cardinality, so it returned `true` when all rhs values were 
present in lhs. That representation mix is possible, for example a small `SET` 
lhs compared with a deserialized roaring `BITMAP` rhs containing the same 
values. In that case `bitmap_has_all(lhs, rhs)` now incorrectly returns 0. 
Please handle `rhs._type == BITMAP` by checking all rhs values against the lhs 
(or by falling back to the old cardinality logic) instead of rejecting 
non-BITMAP lhs representations.



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