Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chore](runtime-filter) adjust need_local_merge setting conditions #33886

Merged
merged 6 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,8 @@ Status PipelineXFragmentContext::prepare(const doris::TPipelineFragmentParams& r
_query_ctx->init_runtime_predicates({0});
}

_need_local_merge =
request.__isset.parallel_instances &&
(request.__isset.per_node_shared_scans && !request.per_node_shared_scans.empty());
_need_local_merge = request.__isset.parallel_instances;

// 2. Build pipelines with operators in this fragment.
auto root_pipeline = add_pipeline();
RETURN_IF_ERROR_OR_CATCH_EXCEPTION(_build_pipelines(
Expand Down Expand Up @@ -929,14 +928,13 @@ Status PipelineXFragmentContext::_create_operator(ObjectPool* pool, const TPlanN
// Therefore, here we need to use a stack-like structure.
_pipeline_parent_map.pop(cur_pipe, parent_idx, child_idx);
std::stringstream error_msg;

switch (tnode.node_type) {
case TPlanNodeType::OLAP_SCAN_NODE: {
op.reset(new OlapScanOperatorX(pool, tnode, next_operator_id(), descs, _num_instances));
RETURN_IF_ERROR(cur_pipe->add_operator(op));
if (find_with_default(request.per_node_shared_scans, op->node_id(), false)) {
if (request.__isset.parallel_instances) {
cur_pipe->set_num_tasks(request.parallel_instances);
}
if (request.__isset.parallel_instances) {
cur_pipe->set_num_tasks(request.parallel_instances);
op->set_ignore_data_distribution();
}
break;
Expand All @@ -950,21 +948,17 @@ Status PipelineXFragmentContext::_create_operator(ObjectPool* pool, const TPlanN
"Jdbc scan node is disabled, you can change be config enable_java_support "
"to true and restart be.");
}
if (find_with_default(request.per_node_shared_scans, op->node_id(), false)) {
if (request.__isset.parallel_instances) {
cur_pipe->set_num_tasks(request.parallel_instances);
}
if (request.__isset.parallel_instances) {
cur_pipe->set_num_tasks(request.parallel_instances);
op->set_ignore_data_distribution();
}
break;
}
case doris::TPlanNodeType::FILE_SCAN_NODE: {
op.reset(new FileScanOperatorX(pool, tnode, next_operator_id(), descs, _num_instances));
RETURN_IF_ERROR(cur_pipe->add_operator(op));
if (find_with_default(request.per_node_shared_scans, op->node_id(), false)) {
if (request.__isset.parallel_instances) {
cur_pipe->set_num_tasks(request.parallel_instances);
}
if (request.__isset.parallel_instances) {
cur_pipe->set_num_tasks(request.parallel_instances);
op->set_ignore_data_distribution();
}
break;
Expand All @@ -973,10 +967,8 @@ Status PipelineXFragmentContext::_create_operator(ObjectPool* pool, const TPlanN
case TPlanNodeType::ES_HTTP_SCAN_NODE: {
op.reset(new EsScanOperatorX(pool, tnode, next_operator_id(), descs, _num_instances));
RETURN_IF_ERROR(cur_pipe->add_operator(op));
if (find_with_default(request.per_node_shared_scans, op->node_id(), false)) {
if (request.__isset.parallel_instances) {
cur_pipe->set_num_tasks(request.parallel_instances);
}
if (request.__isset.parallel_instances) {
cur_pipe->set_num_tasks(request.parallel_instances);
op->set_ignore_data_distribution();
}
break;
Expand Down
3 changes: 0 additions & 3 deletions be/src/runtime/runtime_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,6 @@ Status RuntimeState::register_producer_runtime_filter(const doris::TRuntimeFilte
bool need_local_merge,
doris::IRuntimeFilter** producer_filter,
bool build_bf_exactly) {
// If runtime filter need to be local merged, `build_bf_exactly` will lead to bloom filters with
// different size need to be merged which is not allowed.
// So if `need_local_merge` is true, we will disable `build_bf_exactly`.
if (desc.has_remote_targets || need_local_merge) {
return global_runtime_filter_mgr()->register_local_merge_producer_filter(
desc, query_options(), producer_filter, build_bf_exactly);
Expand Down
Loading