|
15 | 15 | // specific language governing permissions and limitations |
16 | 16 | // under the License. |
17 | 17 |
|
18 | | -#include "final_aggregation_source_operator.h" |
| 18 | +#include "aggregation_source_operator.h" |
19 | 19 |
|
20 | 20 | #include "vec/exec/vaggregation_node.h" |
21 | 21 |
|
22 | 22 | namespace doris { |
23 | 23 | namespace pipeline { |
24 | 24 |
|
25 | | -FinalAggSourceOperator::FinalAggSourceOperator(OperatorTemplate* templ, |
26 | | - vectorized::AggregationNode* node) |
| 25 | +AggregationSourceOperator::AggregationSourceOperator(OperatorTemplate* templ, |
| 26 | + vectorized::AggregationNode* node) |
27 | 27 | : Operator(templ), _agg_node(node) {} |
28 | | -Status FinalAggSourceOperator::init(ExecNode* exec_node, RuntimeState* state) { |
| 28 | + |
| 29 | +Status AggregationSourceOperator::init(ExecNode* exec_node, RuntimeState* state) { |
29 | 30 | RETURN_IF_ERROR(Operator::init(exec_node, state)); |
30 | 31 | return Status::OK(); |
31 | 32 | } |
32 | 33 |
|
33 | 34 | // for poc |
34 | | -Status FinalAggSourceOperator::prepare(RuntimeState* state) { |
| 35 | +Status AggregationSourceOperator::prepare(RuntimeState* state) { |
35 | 36 | _mem_tracker = std::make_unique<MemTracker>( |
36 | | - "FinalAggSourceOperator:" + _runtime_profile->name(), _runtime_profile.get()); |
| 37 | + "AggregationSourceOperator:" + _runtime_profile->name(), _runtime_profile.get()); |
37 | 38 | return Status::OK(); |
38 | 39 | } |
39 | 40 |
|
40 | 41 | // for poc |
41 | | -Status FinalAggSourceOperator::open(RuntimeState* state) { |
| 42 | +Status AggregationSourceOperator::open(RuntimeState* state) { |
42 | 43 | return Status::OK(); |
43 | 44 | } |
44 | 45 |
|
45 | | -bool FinalAggSourceOperator::can_read() { |
46 | | - // TODO: Rethink use can_read() to replace the dependency |
47 | | - return true; |
| 46 | +bool AggregationSourceOperator::can_read() { |
| 47 | + return _agg_node->can_read(); |
48 | 48 | } |
49 | 49 |
|
50 | | -Status FinalAggSourceOperator::get_block(RuntimeState* state, vectorized::Block* block, bool* eos) { |
51 | | - SCOPED_TIMER(_runtime_profile->total_time_counter()); |
52 | | - RETURN_IF_ERROR(_agg_node->_executor.get_result(state, block, eos)); |
53 | | - _agg_node->_make_nullable_output_key(block); |
54 | | - // dispose the having clause, should not be execute in prestreaming agg |
55 | | - RETURN_IF_ERROR(vectorized::VExprContext::filter_block(_agg_node->_vconjunct_ctx_ptr, block, |
56 | | - block->columns())); |
57 | | - reached_limit(block, eos); |
| 50 | +Status AggregationSourceOperator::get_block(RuntimeState* state, vectorized::Block* block, |
| 51 | + bool* eos) { |
| 52 | + RETURN_IF_ERROR(_agg_node->pull(state, block, eos)); |
58 | 53 | _agg_node->_executor.update_memusage(); |
59 | 54 | return Status::OK(); |
60 | 55 | } |
61 | 56 |
|
62 | | -Status FinalAggSourceOperator::close(RuntimeState* state) { |
| 57 | +Status AggregationSourceOperator::close(RuntimeState* state) { |
63 | 58 | _agg_node->release_resource(state); |
64 | 59 | return Status::OK(); |
65 | 60 | } |
66 | 61 |
|
67 | 62 | /////////////////////////////// operator template //////////////////////////////// |
68 | 63 |
|
69 | | -FinalAggSourceOperatorTemplate::FinalAggSourceOperatorTemplate( |
| 64 | +AggregationSourceOperatorTemplate::AggregationSourceOperatorTemplate( |
70 | 65 | int32_t id, const std::string& name, vectorized::AggregationNode* exec_node) |
71 | 66 | : OperatorTemplate(id, name, exec_node) {} |
72 | 67 |
|
73 | | -OperatorPtr FinalAggSourceOperatorTemplate::build_operator() { |
74 | | - return std::make_shared<FinalAggSourceOperator>( |
| 68 | +OperatorPtr AggregationSourceOperatorTemplate::build_operator() { |
| 69 | + return std::make_shared<AggregationSourceOperator>( |
75 | 70 | this, assert_cast<vectorized::AggregationNode*>(_related_exec_node)); |
76 | 71 | } |
77 | 72 |
|
|
0 commit comments