Tanya-W commented on code in PR #14211: URL: https://github.com/apache/doris/pull/14211#discussion_r1058153451
########## be/src/olap/comparison_predicate.h: ########## @@ -180,6 +181,52 @@ class ComparisonPredicateBase : public ColumnPredicate { bitmap); } + Status evaluate(const Schema& schema, InvertedIndexIterator* iterator, + uint32_t num_rows, roaring::Roaring* bitmap) const override { + if (iterator == nullptr) { + return Status::OK(); + } + auto column_desc = schema.column(_column_id); + std::string column_name = column_desc->name(); + + InvertedIndexQueryType query_type; + switch (PT) + { + case PredicateType::EQ: + query_type = InvertedIndexQueryType::EQUAL_QUERY; + break; + case PredicateType::NE: + query_type = InvertedIndexQueryType::EQUAL_QUERY; + break; + case PredicateType::LT: + query_type = InvertedIndexQueryType::LESS_THAN_QUERY; + break; + case PredicateType::LE: + query_type = InvertedIndexQueryType::LESS_EQUAL_QUERY; + break; + case PredicateType::GT: + query_type = InvertedIndexQueryType::GREATER_THAN_QUERY; + break; + case PredicateType::GE: + query_type = InvertedIndexQueryType::GREATER_EQUAL_QUERY; + break; + default: + return Status::InvalidArgument("invalid comparison predicate type {}", PT); + } + + roaring::Roaring roaring; + RETURN_IF_ERROR( + iterator->read_from_inverted_index(column_name, &_value, query_type, num_rows, &roaring)); Review Comment: Besides, in MatchPredicate::evaluate, need the column type to distinguish between array and non array execute logic, input schema as parameter maybe better. -- 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