From fa5dd61563feda9b0f3b9a8a9640ea6325b04282 Mon Sep 17 00:00:00 2001 From: Mryange <59914473+Mryange@users.noreply.github.com> Date: Thu, 19 Oct 2023 19:27:44 +0800 Subject: [PATCH] [feature](pipelineX) operator id use negative numbers (#25529) --- be/src/pipeline/pipeline_x/pipeline_x_fragment_context.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.h b/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.h index ab59178aea..3219b3d107 100644 --- a/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.h +++ b/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.h @@ -111,7 +111,7 @@ public: } } - int next_operator_id() { return _operator_id++; } + int next_operator_id() { return --_operator_id; } private: void _close_action() override; @@ -172,9 +172,10 @@ private: // TODO: Unify `_union_child_pipelines`, `_set_child_pipelines`, `_build_side_pipelines`. std::map> _union_child_pipelines; std::map> _set_child_pipelines; - // The number of operators is generally greater than the number of plan nodes, - // so we need additional ID and cannot rely solely on plan node ID. - int _operator_id = {1000000}; + // We can guarantee that a plan node ID can correspond to an operator ID, + // but some operators do not have a corresponding plan node ID. + // We set these IDs as negative numbers, which are not visible to the user. + int _operator_id = -1; }; } // namespace pipeline