[Bug] runtime filter is not used as expected (#10001)

* [Bug] runtime filter is not used as expected

* update
This commit is contained in:
Gabriel
2022-06-08 11:10:39 +08:00
committed by GitHub
parent dcdfc5b32a
commit 35c3e4e33c
3 changed files with 8 additions and 9 deletions

View File

@ -1574,7 +1574,7 @@ void OlapScanNode::scanner_thread(OlapScanner* scanner) {
bool ready = runtime_filter->is_ready();
if (ready) {
runtime_filter->get_prepared_context(&contexts, row_desc(), _expr_mem_tracker);
_runtime_filter_ctxs[i].apply_mark = true;
scanner_filter_apply_marks[i] = true;
}
}
}

View File

@ -976,15 +976,14 @@ Status IRuntimeFilter::get_prepared_context(std::vector<ExprContext*>* push_expr
DCHECK(is_consumer());
std::lock_guard<std::mutex> guard(_inner_mutex);
if (!_push_down_ctxs.empty()) {
push_expr_ctxs->insert(push_expr_ctxs->end(), _push_down_ctxs.begin(),
_push_down_ctxs.end());
return Status::OK();
if (_push_down_ctxs.empty()) {
RETURN_IF_ERROR(_wrapper->get_push_context(&_push_down_ctxs, _state, _probe_ctx));
RETURN_IF_ERROR(Expr::prepare(_push_down_ctxs, _state, desc, tracker));
RETURN_IF_ERROR(Expr::open(_push_down_ctxs, _state));
}
// push expr
RETURN_IF_ERROR(_wrapper->get_push_context(&_push_down_ctxs, _state, _probe_ctx));
RETURN_IF_ERROR(Expr::prepare(_push_down_ctxs, _state, desc, tracker));
return Expr::open(_push_down_ctxs, _state);
push_expr_ctxs->insert(push_expr_ctxs->end(), _push_down_ctxs.begin(), _push_down_ctxs.end());
return Status::OK();
}
bool IRuntimeFilter::await() {

View File

@ -174,7 +174,7 @@ void VOlapScanNode::scanner_thread(VOlapScanner* scanner) {
bool ready = runtime_filter->is_ready();
if (ready) {
runtime_filter->get_prepared_context(&contexts, row_desc(), _expr_mem_tracker);
_runtime_filter_ctxs[i].apply_mark = true;
scanner_filter_apply_marks[i] = true;
}
}
}