Coverage Report

Created: 2026-07-21 20:17

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exprs/aggregate/aggregate_function_regr.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_regr.h"
19
20
#include "core/data_type/data_type.h"
21
#include "core/data_type/define_primitive_type.h"
22
#include "exprs/aggregate/aggregate_function.h"
23
#include "exprs/aggregate/aggregate_function_simple_factory.h"
24
#include "exprs/aggregate/factory_helpers.h"
25
#include "exprs/aggregate/helpers.h"
26
27
namespace doris {
28
29
template <RegrFunctionKind kind>
30
AggregateFunctionPtr create_aggregate_function_regr(const std::string& name,
31
                                                    const DataTypes& argument_types,
32
                                                    const DataTypePtr& result_type,
33
                                                    const bool result_is_nullable,
34
274
                                                    const AggregateFunctionAttr& attr) {
35
274
    assert_arity_range(name, argument_types, 2, 2);
36
274
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
274
    DCHECK(argument_types[1]->get_primitive_type() == TYPE_DOUBLE);
38
274
    if constexpr (kind == RegrFunctionKind::regr_count) {
39
28
        DCHECK(result_type->get_primitive_type() == TYPE_BIGINT);
40
28
        DCHECK(!result_is_nullable);
41
246
    } else {
42
246
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
246
        DCHECK(result_is_nullable);
44
246
    }
45
46
274
    bool y_nullable_input = argument_types[0]->is_nullable();
47
274
    bool x_nullable_input = argument_types[1]->is_nullable();
48
274
    if (y_nullable_input) {
49
163
        if (x_nullable_input) {
50
106
            return creator_without_type::create_ignore_nullable<
51
106
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
106
                                                                          result_is_nullable, attr);
53
106
        } else {
54
57
            return creator_without_type::create_ignore_nullable<
55
57
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
57
                    argument_types, result_is_nullable, attr);
57
57
        }
58
163
    } else {
59
111
        if (x_nullable_input) {
60
45
            return creator_without_type::create_ignore_nullable<
61
45
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
45
                    argument_types, result_is_nullable, attr);
63
66
        } else {
64
66
            return creator_without_type::create_ignore_nullable<
65
66
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
66
                    argument_types, result_is_nullable, attr);
67
66
        }
68
111
    }
69
274
}
_ZN5doris30create_aggregate_function_regrILNS_16RegrFunctionKindE0EEESt10shared_ptrINS_18IAggregateFunctionEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS2_IKNS_9IDataTypeEESaISG_EERKSG_bRKNS_21AggregateFunctionAttrE
Line
Count
Source
34
28
                                                    const AggregateFunctionAttr& attr) {
35
28
    assert_arity_range(name, argument_types, 2, 2);
36
28
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
28
    DCHECK(argument_types[1]->get_primitive_type() == TYPE_DOUBLE);
38
    if constexpr (kind == RegrFunctionKind::regr_count) {
39
        DCHECK(result_type->get_primitive_type() == TYPE_BIGINT);
40
        DCHECK(!result_is_nullable);
41
28
    } else {
42
28
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
28
        DCHECK(result_is_nullable);
44
28
    }
45
46
28
    bool y_nullable_input = argument_types[0]->is_nullable();
47
28
    bool x_nullable_input = argument_types[1]->is_nullable();
48
28
    if (y_nullable_input) {
49
16
        if (x_nullable_input) {
50
11
            return creator_without_type::create_ignore_nullable<
51
11
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
11
                                                                          result_is_nullable, attr);
53
11
        } else {
54
5
            return creator_without_type::create_ignore_nullable<
55
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
5
                    argument_types, result_is_nullable, attr);
57
5
        }
58
16
    } else {
59
12
        if (x_nullable_input) {
60
5
            return creator_without_type::create_ignore_nullable<
61
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
5
                    argument_types, result_is_nullable, attr);
63
7
        } else {
64
7
            return creator_without_type::create_ignore_nullable<
65
7
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
7
                    argument_types, result_is_nullable, attr);
67
7
        }
68
12
    }
69
28
}
_ZN5doris30create_aggregate_function_regrILNS_16RegrFunctionKindE1EEESt10shared_ptrINS_18IAggregateFunctionEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS2_IKNS_9IDataTypeEESaISG_EERKSG_bRKNS_21AggregateFunctionAttrE
Line
Count
Source
34
28
                                                    const AggregateFunctionAttr& attr) {
35
28
    assert_arity_range(name, argument_types, 2, 2);
36
28
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
28
    DCHECK(argument_types[1]->get_primitive_type() == TYPE_DOUBLE);
38
    if constexpr (kind == RegrFunctionKind::regr_count) {
39
        DCHECK(result_type->get_primitive_type() == TYPE_BIGINT);
40
        DCHECK(!result_is_nullable);
41
28
    } else {
42
28
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
28
        DCHECK(result_is_nullable);
44
28
    }
45
46
28
    bool y_nullable_input = argument_types[0]->is_nullable();
47
28
    bool x_nullable_input = argument_types[1]->is_nullable();
48
28
    if (y_nullable_input) {
49
16
        if (x_nullable_input) {
50
11
            return creator_without_type::create_ignore_nullable<
51
11
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
11
                                                                          result_is_nullable, attr);
53
11
        } else {
54
5
            return creator_without_type::create_ignore_nullable<
55
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
5
                    argument_types, result_is_nullable, attr);
57
5
        }
58
16
    } else {
59
12
        if (x_nullable_input) {
60
5
            return creator_without_type::create_ignore_nullable<
61
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
5
                    argument_types, result_is_nullable, attr);
63
7
        } else {
64
7
            return creator_without_type::create_ignore_nullable<
65
7
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
7
                    argument_types, result_is_nullable, attr);
67
7
        }
68
12
    }
69
28
}
_ZN5doris30create_aggregate_function_regrILNS_16RegrFunctionKindE2EEESt10shared_ptrINS_18IAggregateFunctionEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS2_IKNS_9IDataTypeEESaISG_EERKSG_bRKNS_21AggregateFunctionAttrE
Line
Count
Source
34
28
                                                    const AggregateFunctionAttr& attr) {
35
28
    assert_arity_range(name, argument_types, 2, 2);
36
28
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
28
    DCHECK(argument_types[1]->get_primitive_type() == TYPE_DOUBLE);
38
28
    if constexpr (kind == RegrFunctionKind::regr_count) {
39
28
        DCHECK(result_type->get_primitive_type() == TYPE_BIGINT);
40
28
        DCHECK(!result_is_nullable);
41
    } else {
42
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
        DCHECK(result_is_nullable);
44
    }
45
46
28
    bool y_nullable_input = argument_types[0]->is_nullable();
47
28
    bool x_nullable_input = argument_types[1]->is_nullable();
48
28
    if (y_nullable_input) {
49
16
        if (x_nullable_input) {
50
11
            return creator_without_type::create_ignore_nullable<
51
11
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
11
                                                                          result_is_nullable, attr);
53
11
        } else {
54
5
            return creator_without_type::create_ignore_nullable<
55
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
5
                    argument_types, result_is_nullable, attr);
57
5
        }
58
16
    } else {
59
12
        if (x_nullable_input) {
60
5
            return creator_without_type::create_ignore_nullable<
61
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
5
                    argument_types, result_is_nullable, attr);
63
7
        } else {
64
7
            return creator_without_type::create_ignore_nullable<
65
7
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
7
                    argument_types, result_is_nullable, attr);
67
7
        }
68
12
    }
69
28
}
_ZN5doris30create_aggregate_function_regrILNS_16RegrFunctionKindE3EEESt10shared_ptrINS_18IAggregateFunctionEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS2_IKNS_9IDataTypeEESaISG_EERKSG_bRKNS_21AggregateFunctionAttrE
Line
Count
Source
34
48
                                                    const AggregateFunctionAttr& attr) {
35
48
    assert_arity_range(name, argument_types, 2, 2);
36
48
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
48
    DCHECK(argument_types[1]->get_primitive_type() == TYPE_DOUBLE);
38
    if constexpr (kind == RegrFunctionKind::regr_count) {
39
        DCHECK(result_type->get_primitive_type() == TYPE_BIGINT);
40
        DCHECK(!result_is_nullable);
41
48
    } else {
42
48
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
48
        DCHECK(result_is_nullable);
44
48
    }
45
46
48
    bool y_nullable_input = argument_types[0]->is_nullable();
47
48
    bool x_nullable_input = argument_types[1]->is_nullable();
48
48
    if (y_nullable_input) {
49
33
        if (x_nullable_input) {
50
22
            return creator_without_type::create_ignore_nullable<
51
22
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
22
                                                                          result_is_nullable, attr);
53
22
        } else {
54
11
            return creator_without_type::create_ignore_nullable<
55
11
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
11
                    argument_types, result_is_nullable, attr);
57
11
        }
58
33
    } else {
59
15
        if (x_nullable_input) {
60
5
            return creator_without_type::create_ignore_nullable<
61
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
5
                    argument_types, result_is_nullable, attr);
63
10
        } else {
64
10
            return creator_without_type::create_ignore_nullable<
65
10
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
10
                    argument_types, result_is_nullable, attr);
67
10
        }
68
15
    }
69
48
}
_ZN5doris30create_aggregate_function_regrILNS_16RegrFunctionKindE4EEESt10shared_ptrINS_18IAggregateFunctionEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS2_IKNS_9IDataTypeEESaISG_EERKSG_bRKNS_21AggregateFunctionAttrE
Line
Count
Source
34
48
                                                    const AggregateFunctionAttr& attr) {
35
48
    assert_arity_range(name, argument_types, 2, 2);
36
48
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
48
    DCHECK(argument_types[1]->get_primitive_type() == TYPE_DOUBLE);
38
    if constexpr (kind == RegrFunctionKind::regr_count) {
39
        DCHECK(result_type->get_primitive_type() == TYPE_BIGINT);
40
        DCHECK(!result_is_nullable);
41
48
    } else {
42
48
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
48
        DCHECK(result_is_nullable);
44
48
    }
45
46
48
    bool y_nullable_input = argument_types[0]->is_nullable();
47
48
    bool x_nullable_input = argument_types[1]->is_nullable();
48
48
    if (y_nullable_input) {
49
33
        if (x_nullable_input) {
50
22
            return creator_without_type::create_ignore_nullable<
51
22
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
22
                                                                          result_is_nullable, attr);
53
22
        } else {
54
11
            return creator_without_type::create_ignore_nullable<
55
11
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
11
                    argument_types, result_is_nullable, attr);
57
11
        }
58
33
    } else {
59
15
        if (x_nullable_input) {
60
5
            return creator_without_type::create_ignore_nullable<
61
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
5
                    argument_types, result_is_nullable, attr);
63
10
        } else {
64
10
            return creator_without_type::create_ignore_nullable<
65
10
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
10
                    argument_types, result_is_nullable, attr);
67
10
        }
68
15
    }
69
48
}
_ZN5doris30create_aggregate_function_regrILNS_16RegrFunctionKindE5EEESt10shared_ptrINS_18IAggregateFunctionEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS2_IKNS_9IDataTypeEESaISG_EERKSG_bRKNS_21AggregateFunctionAttrE
Line
Count
Source
34
22
                                                    const AggregateFunctionAttr& attr) {
35
22
    assert_arity_range(name, argument_types, 2, 2);
36
22
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
22
    DCHECK(argument_types[1]->get_primitive_type() == TYPE_DOUBLE);
38
    if constexpr (kind == RegrFunctionKind::regr_count) {
39
        DCHECK(result_type->get_primitive_type() == TYPE_BIGINT);
40
        DCHECK(!result_is_nullable);
41
22
    } else {
42
22
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
22
        DCHECK(result_is_nullable);
44
22
    }
45
46
22
    bool y_nullable_input = argument_types[0]->is_nullable();
47
22
    bool x_nullable_input = argument_types[1]->is_nullable();
48
22
    if (y_nullable_input) {
49
11
        if (x_nullable_input) {
50
6
            return creator_without_type::create_ignore_nullable<
51
6
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
6
                                                                          result_is_nullable, attr);
53
6
        } else {
54
5
            return creator_without_type::create_ignore_nullable<
55
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
5
                    argument_types, result_is_nullable, attr);
57
5
        }
58
11
    } else {
59
11
        if (x_nullable_input) {
60
5
            return creator_without_type::create_ignore_nullable<
61
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
5
                    argument_types, result_is_nullable, attr);
63
6
        } else {
64
6
            return creator_without_type::create_ignore_nullable<
65
6
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
6
                    argument_types, result_is_nullable, attr);
67
6
        }
68
11
    }
69
22
}
_ZN5doris30create_aggregate_function_regrILNS_16RegrFunctionKindE6EEESt10shared_ptrINS_18IAggregateFunctionEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS2_IKNS_9IDataTypeEESaISG_EERKSG_bRKNS_21AggregateFunctionAttrE
Line
Count
Source
34
22
                                                    const AggregateFunctionAttr& attr) {
35
22
    assert_arity_range(name, argument_types, 2, 2);
36
22
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
22
    DCHECK(argument_types[1]->get_primitive_type() == TYPE_DOUBLE);
38
    if constexpr (kind == RegrFunctionKind::regr_count) {
39
        DCHECK(result_type->get_primitive_type() == TYPE_BIGINT);
40
        DCHECK(!result_is_nullable);
41
22
    } else {
42
22
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
22
        DCHECK(result_is_nullable);
44
22
    }
45
46
22
    bool y_nullable_input = argument_types[0]->is_nullable();
47
22
    bool x_nullable_input = argument_types[1]->is_nullable();
48
22
    if (y_nullable_input) {
49
11
        if (x_nullable_input) {
50
6
            return creator_without_type::create_ignore_nullable<
51
6
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
6
                                                                          result_is_nullable, attr);
53
6
        } else {
54
5
            return creator_without_type::create_ignore_nullable<
55
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
5
                    argument_types, result_is_nullable, attr);
57
5
        }
58
11
    } else {
59
11
        if (x_nullable_input) {
60
5
            return creator_without_type::create_ignore_nullable<
61
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
5
                    argument_types, result_is_nullable, attr);
63
6
        } else {
64
6
            return creator_without_type::create_ignore_nullable<
65
6
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
6
                    argument_types, result_is_nullable, attr);
67
6
        }
68
11
    }
69
22
}
_ZN5doris30create_aggregate_function_regrILNS_16RegrFunctionKindE7EEESt10shared_ptrINS_18IAggregateFunctionEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS2_IKNS_9IDataTypeEESaISG_EERKSG_bRKNS_21AggregateFunctionAttrE
Line
Count
Source
34
22
                                                    const AggregateFunctionAttr& attr) {
35
22
    assert_arity_range(name, argument_types, 2, 2);
36
22
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
22
    DCHECK(argument_types[1]->get_primitive_type() == TYPE_DOUBLE);
38
    if constexpr (kind == RegrFunctionKind::regr_count) {
39
        DCHECK(result_type->get_primitive_type() == TYPE_BIGINT);
40
        DCHECK(!result_is_nullable);
41
22
    } else {
42
22
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
22
        DCHECK(result_is_nullable);
44
22
    }
45
46
22
    bool y_nullable_input = argument_types[0]->is_nullable();
47
22
    bool x_nullable_input = argument_types[1]->is_nullable();
48
22
    if (y_nullable_input) {
49
11
        if (x_nullable_input) {
50
6
            return creator_without_type::create_ignore_nullable<
51
6
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
6
                                                                          result_is_nullable, attr);
53
6
        } else {
54
5
            return creator_without_type::create_ignore_nullable<
55
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
5
                    argument_types, result_is_nullable, attr);
57
5
        }
58
11
    } else {
59
11
        if (x_nullable_input) {
60
5
            return creator_without_type::create_ignore_nullable<
61
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
5
                    argument_types, result_is_nullable, attr);
63
6
        } else {
64
6
            return creator_without_type::create_ignore_nullable<
65
6
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
6
                    argument_types, result_is_nullable, attr);
67
6
        }
68
11
    }
69
22
}
_ZN5doris30create_aggregate_function_regrILNS_16RegrFunctionKindE8EEESt10shared_ptrINS_18IAggregateFunctionEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS2_IKNS_9IDataTypeEESaISG_EERKSG_bRKNS_21AggregateFunctionAttrE
Line
Count
Source
34
28
                                                    const AggregateFunctionAttr& attr) {
35
28
    assert_arity_range(name, argument_types, 2, 2);
36
28
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
28
    DCHECK(argument_types[1]->get_primitive_type() == TYPE_DOUBLE);
38
    if constexpr (kind == RegrFunctionKind::regr_count) {
39
        DCHECK(result_type->get_primitive_type() == TYPE_BIGINT);
40
        DCHECK(!result_is_nullable);
41
28
    } else {
42
28
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
28
        DCHECK(result_is_nullable);
44
28
    }
45
46
28
    bool y_nullable_input = argument_types[0]->is_nullable();
47
28
    bool x_nullable_input = argument_types[1]->is_nullable();
48
28
    if (y_nullable_input) {
49
16
        if (x_nullable_input) {
50
11
            return creator_without_type::create_ignore_nullable<
51
11
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
11
                                                                          result_is_nullable, attr);
53
11
        } else {
54
5
            return creator_without_type::create_ignore_nullable<
55
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
5
                    argument_types, result_is_nullable, attr);
57
5
        }
58
16
    } else {
59
12
        if (x_nullable_input) {
60
5
            return creator_without_type::create_ignore_nullable<
61
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
5
                    argument_types, result_is_nullable, attr);
63
7
        } else {
64
7
            return creator_without_type::create_ignore_nullable<
65
7
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
7
                    argument_types, result_is_nullable, attr);
67
7
        }
68
12
    }
69
28
}
70
71
7
void register_aggregate_function_regr(AggregateFunctionSimpleFactory& factory) {
72
7
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_avgx>::name,
73
7
                                   create_aggregate_function_regr<RegrFunctionKind::regr_avgx>);
74
7
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_avgy>::name,
75
7
                                   create_aggregate_function_regr<RegrFunctionKind::regr_avgy>);
76
7
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_count>::name,
77
7
                                   create_aggregate_function_regr<RegrFunctionKind::regr_count>);
78
7
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_slope>::name,
79
7
                                   create_aggregate_function_regr<RegrFunctionKind::regr_slope>);
80
7
    factory.register_function_both(
81
7
            RegrTraits<RegrFunctionKind::regr_intercept>::name,
82
7
            create_aggregate_function_regr<RegrFunctionKind::regr_intercept>);
83
7
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_sxx>::name,
84
7
                                   create_aggregate_function_regr<RegrFunctionKind::regr_sxx>);
85
7
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_syy>::name,
86
7
                                   create_aggregate_function_regr<RegrFunctionKind::regr_syy>);
87
7
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_sxy>::name,
88
7
                                   create_aggregate_function_regr<RegrFunctionKind::regr_sxy>);
89
7
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_r2>::name,
90
7
                                   create_aggregate_function_regr<RegrFunctionKind::regr_r2>);
91
7
}
92
93
} // namespace doris