github-actions[bot] commented on code in PR #35682: URL: https://github.com/apache/doris/pull/35682#discussion_r1622453094
########## be/src/pipeline/exec/sort_source_operator.cpp: ########## @@ -28,7 +29,33 @@ SortSourceOperatorX::SortSourceOperatorX(ObjectPool* pool, const TPlanNode& tnode, int operator_id, const DescriptorTbl& descs) - : OperatorX<SortLocalState>(pool, tnode, operator_id, descs) {} + : OperatorX<SortLocalState>(pool, tnode, operator_id, descs), + _merge_by_exchange(tnode.sort_node.merge_by_exchange), + _offset(tnode.sort_node.__isset.offset ? tnode.sort_node.offset : 0) {} + +Status SortSourceOperatorX::init(const TPlanNode& tnode, RuntimeState* state) { + RETURN_IF_ERROR(Base::init(tnode, state)); + RETURN_IF_ERROR(_vsort_exec_exprs.init(tnode.sort_node.sort_info, _pool)); + _is_asc_order = tnode.sort_node.sort_info.is_asc_order; + _nulls_first = tnode.sort_node.sort_info.nulls_first; + return Status::OK(); +} + +Status SortSourceOperatorX::prepare(RuntimeState* state) { + RETURN_IF_ERROR(Base::prepare(state)); + if (use_local_merge()) { + RETURN_IF_ERROR(_vsort_exec_exprs.prepare(state, _child_x->row_desc(), _row_descriptor)); + } + return Status::OK(); +} + +Status SortSourceOperatorX::open(RuntimeState* state) { Review Comment: warning: method 'open' can be made const [readability-make-member-function-const] ```suggestion Status SortSourceOperatorX::open(RuntimeState* state) const constStatus SortSourceOperatorX::open(RuntimeState* state) { ``` ########## be/src/pipeline/exec/sort_source_operator.cpp: ########## @@ -28,7 +29,33 @@ SortLocalState::SortLocalState(RuntimeState* state, OperatorXBase* parent) SortSourceOperatorX::SortSourceOperatorX(ObjectPool* pool, const TPlanNode& tnode, int operator_id, const DescriptorTbl& descs) - : OperatorX<SortLocalState>(pool, tnode, operator_id, descs) {} + : OperatorX<SortLocalState>(pool, tnode, operator_id, descs), + _merge_by_exchange(tnode.sort_node.merge_by_exchange), + _offset(tnode.sort_node.__isset.offset ? tnode.sort_node.offset : 0) {} + +Status SortSourceOperatorX::init(const TPlanNode& tnode, RuntimeState* state) { + RETURN_IF_ERROR(Base::init(tnode, state)); + RETURN_IF_ERROR(_vsort_exec_exprs.init(tnode.sort_node.sort_info, _pool)); + _is_asc_order = tnode.sort_node.sort_info.is_asc_order; + _nulls_first = tnode.sort_node.sort_info.nulls_first; + return Status::OK(); +} + +Status SortSourceOperatorX::prepare(RuntimeState* state) { Review Comment: warning: method 'prepare' can be made const [readability-make-member-function-const] ```suggestion Status SortSourceOperatorX::prepare(RuntimeState* state) const { ``` be/src/pipeline/exec/sort_source_operator.h:50: ```diff - Status prepare(RuntimeState* state) override; + Status prepare(RuntimeState* state) const override; ``` -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org