be/src/exprs/aggregate/aggregate_function_reader.cpp
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 | | #include "exprs/aggregate/aggregate_function_reader.h" |
19 | | |
20 | | #include <algorithm> |
21 | | #include <string> |
22 | | |
23 | | #include "exprs/aggregate/aggregate_function_bitmap.h" |
24 | | #include "exprs/aggregate/aggregate_function_hll_union_agg.h" |
25 | | #include "exprs/aggregate/aggregate_function_min_max.h" |
26 | | #include "exprs/aggregate/aggregate_function_quantile_state.h" |
27 | | #include "exprs/aggregate/aggregate_function_simple_factory.h" |
28 | | #include "exprs/aggregate/aggregate_function_sum.h" |
29 | | #include "exprs/aggregate/helpers.h" |
30 | | |
31 | | namespace doris { |
32 | | #include "common/compile_check_begin.h" |
33 | | |
34 | | // auto spread at nullable condition, null value do not participate aggregate |
35 | 8 | void register_aggregate_function_reader_load(AggregateFunctionSimpleFactory& factory) { |
36 | | // add a suffix to the function name here to distinguish special functions of agg reader |
37 | 8 | auto register_function_both = [&](const std::string& name, |
38 | 48 | const AggregateFunctionCreator& creator) { |
39 | 48 | factory.register_function_both(name + AGG_READER_SUFFIX, creator); |
40 | 48 | factory.register_function_both(name + AGG_LOAD_SUFFIX, creator); |
41 | 48 | }; |
42 | | |
43 | 8 | register_function_both( |
44 | 8 | "sum", |
45 | 8 | creator_with_type_list<TYPE_TINYINT, TYPE_SMALLINT, TYPE_INT, TYPE_BIGINT, |
46 | 8 | TYPE_LARGEINT, TYPE_FLOAT, TYPE_DOUBLE, TYPE_DECIMAL32, |
47 | 8 | TYPE_DECIMAL64, TYPE_DECIMAL128I, TYPE_DECIMAL256, |
48 | 8 | TYPE_DECIMALV2>::creator<AggregateFunctionSumSimpleReader>); |
49 | 8 | register_function_both("max", create_aggregate_function_single_value<AggregateFunctionMaxData>); |
50 | 8 | register_function_both("min", create_aggregate_function_single_value<AggregateFunctionMinData>); |
51 | 8 | register_function_both("bitmap_union", |
52 | 8 | creator_without_type::creator< |
53 | 8 | AggregateFunctionBitmapOp<AggregateFunctionBitmapUnionOp>>); |
54 | 8 | register_function_both("hll_union", |
55 | 8 | creator_without_type::creator<AggregateFunctionHLLUnion< |
56 | 8 | AggregateFunctionHLLUnionImpl<AggregateFunctionHLLData>>>); |
57 | 8 | register_function_both("quantile_union", create_aggregate_function_quantile_state_union); |
58 | 8 | } |
59 | | |
60 | | } // namespace doris |