kangkaisen commented on a change in pull request #2319: Add Bitmap index reader
URL: https://github.com/apache/incubator-doris/pull/2319#discussion_r352554409
##########
File path: be/src/olap/in_list_predicate.cpp
##########
@@ -109,6 +111,44 @@ IN_LIST_PRED_EVALUATE(NotInListPredicate, ==)
IN_LIST_PRED_COLUMN_BLOCK_EVALUATE(InListPredicate, !=)
IN_LIST_PRED_COLUMN_BLOCK_EVALUATE(NotInListPredicate, ==)
+#define IN_LIST_PRED_BITMAP_EVALUATE(CLASS, OP) \
+ template<class type> \
+ Status CLASS<type>::evaluate(const Schema& schema, const
vector<BitmapIndexIterator*>& iterators, uint32_t num_rows, Roaring* bitmap)
const { \
+ BitmapIndexIterator *iterator = iterators[_column_id]; \
+ if (iterator == nullptr) { \
+ return Status::OK(); \
+ } \
+ if (iterator->has_null_bitmap()) { \
+ Roaring null_bitmap; \
+ RETURN_IF_ERROR(iterator->read_null_bitmap(&null_bitmap)); \
+ *bitmap -= null_bitmap; \
+ } \
+ std::string op = getop(OP); \
+ Roaring roaring; \
+ for (auto value:_values) { \
+ bool exact_match; \
+ Status s = iterator->seek_dictionary(&value, &exact_match); \
+ rowid_t seeked_ordinal = iterator->current_ordinal(); \
+ if (!s.is_not_found()) { \
+ if (!s.ok()) { return s; } \
+ if (exact_match) { \
+ Roaring bitmap; \
+ RETURN_IF_ERROR(iterator->read_bitmap(seeked_ordinal,
&bitmap)); \
+ roaring |= bitmap; \
+ } \
+ } \
+ } \
+ if (op.compare("==") == 0) { \
+ *bitmap &= roaring; \
+ } else { \
+ *bitmap -= roaring; \
+ } \
Review comment:
done
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]