be/src/exprs/table_function/vexplode_bitmap.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 <cstddef> |
21 | | #include <memory> |
22 | | |
23 | | #include "common/status.h" |
24 | | #include "core/data_type/data_type.h" |
25 | | #include "core/value/bitmap_value.h" |
26 | | #include "exprs/table_function/table_function.h" |
27 | | |
28 | | namespace doris { |
29 | | #include "common/compile_check_begin.h" |
30 | | |
31 | | class Block; |
32 | | |
33 | | class VExplodeBitmapTableFunction final : public TableFunction { |
34 | | ENABLE_FACTORY_CREATOR(VExplodeBitmapTableFunction); |
35 | | |
36 | | public: |
37 | | VExplodeBitmapTableFunction(); |
38 | 0 | ~VExplodeBitmapTableFunction() override = default; |
39 | | |
40 | | void reset() override; |
41 | | void get_same_many_values(MutableColumnPtr& column, int length) override; |
42 | | int get_value(MutableColumnPtr& column, int max_step) override; |
43 | | |
44 | | void forward(int step = 1) override; |
45 | | |
46 | | Status process_init(Block* block, RuntimeState* state) override; |
47 | | void process_row(size_t row_idx) override; |
48 | | void process_close() override; |
49 | | |
50 | | private: |
51 | | void _reset_iterator(); |
52 | | // Not own object, just a reference |
53 | | const BitmapValue* _cur_bitmap = nullptr; |
54 | | // iterator of _cur_bitmap |
55 | | std::unique_ptr<BitmapValueIterator> _cur_iter; |
56 | | ColumnPtr _value_column; |
57 | | }; |
58 | | |
59 | | #include "common/compile_check_end.h" |
60 | | } // namespace doris |