Gabriel39 commented on code in PR #25448:
URL: https://github.com/apache/doris/pull/25448#discussion_r1360027181
##########
be/src/pipeline/exec/multi_cast_data_stream_sink.cpp:
##########
@@ -33,4 +33,18 @@ std::string MultiCastDataStreamSinkLocalState::id_name() {
return id_name;
}
+Status MultiCastDataStreamSinkLocalState::init(RuntimeState* state,
LocalSinkStateInfo& info) {
+ auto multi_cast_data_streamer =
static_cast<MultiCastDataStreamSinkOperatorX*>(_parent)
+
->create_multi_cast_data_streamer();
+ RETURN_IF_ERROR(Base::init(state, info));
+ _shared_state->multi_cast_data_streamer = multi_cast_data_streamer;
+ auto& deps = info.dependencys;
+ for (int i = 1; i < deps.size(); i++) {
+ auto& dep = deps[i];
+ auto* _other_shared_state = (typename
MultiCastDependency::SharedState*)dep->shared_state();
+ _other_shared_state->multi_cast_data_streamer =
_shared_state->multi_cast_data_streamer;
Review Comment:
Share this state between dependency instead of `multi_cast_data_streamer`
##########
be/src/pipeline/pipeline_x/pipeline_x_task.cpp:
##########
@@ -81,16 +80,16 @@ Status PipelineXTask::prepare(RuntimeState* state, const
TPipelineInstanceParams
for (int op_idx = _operators.size() - 1; op_idx >= 0; op_idx--) {
auto& deps = get_upstream_dependency(_operators[op_idx]->id());
- std::vector<LocalStateInfo> infos;
+ LocalStateInfo info {
+ op_idx == _operators.size() - 1
+ ? _parent_profile
+ : state->get_local_state(_operators[op_idx +
1]->id())->profile(),
+ scan_ranges,
+ {}};
for (auto& dep : deps) {
- LocalStateInfo info {
- op_idx == _operators.size() - 1
- ? _parent_profile
- : state->get_local_state(_operators[op_idx +
1]->id())->profile(),
- scan_ranges, dep.get()};
- infos.emplace_back(info);
+ info.dependencys.push_back(dep.get());
Review Comment:
Maybe we can use shared_ptr<Dependency> to skip this loop
##########
be/src/pipeline/exec/union_source_operator.cpp:
##########
@@ -103,6 +103,18 @@ Status UnionSourceLocalState::init(RuntimeState* state,
LocalStateInfo& info) {
SCOPED_TIMER(profile()->total_time_counter());
SCOPED_TIMER(_open_timer);
auto& p = _parent->cast<Parent>();
+ int child_count = p.get_child_count();
+ std::shared_ptr<DataQueue> data_queue;
+ if (child_count != 0) {
+ auto data_queue = create_data_queue();
+ auto& deps = info.dependencys;
+ _shared_state->data_queue = data_queue;
+ for (int i = 1; i < deps.size(); i++) {
+ auto& dep = deps[i];
+ auto* _other_shared_state = (typename
UnionDependency::SharedState*)dep->shared_state();
+ _other_shared_state->data_queue = data_queue;
Review Comment:
Share this state between dependency instead of `data_queue`
--
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]