be/src/exec/operator/select_operator.h
Line | Count | Source |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. You may obtain a copy of the License at |
8 | | // |
9 | | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | | // |
11 | | // Unless required by applicable law or agreed to in writing, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | |
18 | | #pragma once |
19 | | |
20 | | #include <stdint.h> |
21 | | |
22 | | #include "exec/operator/operator.h" |
23 | | |
24 | | namespace doris { |
25 | | #include "common/compile_check_begin.h" |
26 | | |
27 | | class SelectOperatorX; |
28 | | class SelectLocalState final : public PipelineXLocalState<FakeSharedState> { |
29 | | public: |
30 | | ENABLE_FACTORY_CREATOR(SelectLocalState); |
31 | | |
32 | | SelectLocalState(RuntimeState* state, OperatorXBase* parent) |
33 | 0 | : PipelineXLocalState<FakeSharedState>(state, parent) {} |
34 | 0 | ~SelectLocalState() = default; |
35 | | |
36 | | private: |
37 | | friend class SelectOperatorX; |
38 | | }; |
39 | | |
40 | | class SelectOperatorX final : public StreamingOperatorX<SelectLocalState> { |
41 | | public: |
42 | | SelectOperatorX(ObjectPool* pool, const TPlanNode& tnode, int operator_id, |
43 | | const DescriptorTbl& descs) |
44 | 0 | : StreamingOperatorX<SelectLocalState>(pool, tnode, operator_id, descs) {} |
45 | | |
46 | 0 | Status pull(RuntimeState* state, Block* block, bool* eos) override { |
47 | 0 | auto& local_state = get_local_state(state); |
48 | 0 | SCOPED_TIMER(local_state.exec_time_counter()); |
49 | 0 | RETURN_IF_CANCELLED(state); |
50 | 0 | RETURN_IF_ERROR(local_state.filter_block(local_state._conjuncts, block)); |
51 | 0 | local_state.reached_limit(block, eos); |
52 | 0 | return Status::OK(); |
53 | 0 | } |
54 | | |
55 | 0 | [[nodiscard]] bool is_source() const override { return false; } |
56 | | }; |
57 | | |
58 | | #include "common/compile_check_end.h" |
59 | | } // namespace doris |