BiteTheDDDDt commented on a change in pull request #7645:
URL: https://github.com/apache/incubator-doris/pull/7645#discussion_r780740721
##########
File path: be/src/exprs/runtime_filter_slots.h
##########
@@ -60,7 +60,27 @@ class RuntimeFilterSlotsBase {
runtime_filter->publish_finally();
};
- for (auto& filter_desc : _runtime_filter_descs) {
+ // ordered vector: IN, IN_OR_BLOOM, others.
+ // so we can ignore other filter if IN Predicate exists.
+ std::vector<TRuntimeFilterDesc>
sorted_runtime_filter_descs(_runtime_filter_descs);
+ auto compare_desc = [](TRuntimeFilterDesc& d1, TRuntimeFilterDesc& d2)
{
+ if (d1.type == d2.type) {
+ return 0;
+ } else if (d1.type == TRuntimeFilterType::IN) {
+ return -1;
+ } else if (d2.type == TRuntimeFilterType::IN) {
+ return 1;
+ } else if (d1.type == TRuntimeFilterType::IN_OR_BLOOM) {
+ return -1;
+ } else if (d2.type == TRuntimeFilterType::IN_OR_BLOOM) {
+ return 1;
+ } else {
+ return d1.type < d2.type ? -1 : 1;
+ }
+ };
+ std::sort(sorted_runtime_filter_descs.begin(),
sorted_runtime_filter_descs.end(), compare_desc);
Review comment:
It is ok to `compare_desc` return `-1` or `1`?
https://en.cppreference.com/w/cpp/named_req/Compare
--
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]