HappenLee commented on code in PR #14928: URL: https://github.com/apache/doris/pull/14928#discussion_r1043070291
########## be/src/pipeline/exec/operator.h: ########## @@ -338,22 +346,51 @@ class Operator : public OperatorBase { }; template <typename OperatorBuilderType> -class DataStateOperator : public Operator<OperatorBuilderType> { +class SourceOperator : public StreamingOperator<OperatorBuilderType> { +public: + using NodeType = + std::remove_pointer_t<decltype(std::declval<OperatorBuilderType>().exec_node())>; + + SourceOperator(OperatorBuilderBase* builder, ExecNode* node) + : StreamingOperator<OperatorBuilderType>(builder, node) {}; + + ~SourceOperator() override = default; + + std::string get_name() const override { return "SourceOperator"; } + + Status get_block(RuntimeState* state, vectorized::Block* block, + SourceState& source_state) override { + SCOPED_TIMER(_runtime_profile->total_time_counter()); + bool eos = false; + RETURN_IF_ERROR(_node->pull(state, block, &eos)); + source_state = eos ? SourceState::FINISHED : SourceState::DEPEND_ON_SOURCE; + return Status::OK(); + } + + Status finalize(RuntimeState* state) override { return Status::OK(); } Review Comment: Do not need override the method `finalize` and `can_read` -- 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