kangkaisen commented on a change in pull request #2319: Add Bitmap index reader
URL: https://github.com/apache/incubator-doris/pull/2319#discussion_r352554321
##########
File path: be/src/olap/comparison_predicate.cpp
##########
@@ -138,6 +142,75 @@ COMPARISON_PRED_COLUMN_BLOCK_EVALUATE(LessEqualPredicate,
<=)
COMPARISON_PRED_COLUMN_BLOCK_EVALUATE(GreaterPredicate, >)
COMPARISON_PRED_COLUMN_BLOCK_EVALUATE(GreaterEqualPredicate, >=)
+#define COMPARISON_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(); \
+ } \
+ std::string op = getop(OP); \
+ rowid_t ordinal_limit = iterator->bitmap_nums(); \
+ if (iterator->has_null_bitmap()) { \
+ ordinal_limit--; \
+ Roaring null_bitmap; \
+ RETURN_IF_ERROR(iterator->read_null_bitmap(&null_bitmap)); \
+ *bitmap -= null_bitmap; \
+ } \
+ Roaring roaring; \
+ bool exact_match; \
+ Status s = iterator->seek_dictionary(&_value, &exact_match); \
+ rowid_t seeked_ordinal = iterator->current_ordinal(); \
+ if (op.compare("==") == 0) { \
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]