Coverage Report

Created: 2026-06-04 13:51

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
307
                                                    const AggregateFunctionAttr& attr) {
35
307
    assert_arity_range(name, argument_types, 2, 2);
36
307
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
307
    DCHECK(argument_types[1]->get_primitive_type() == TYPE_DOUBLE);
38
307
    if constexpr (kind == RegrFunctionKind::regr_count) {
39
28
        DCHECK(result_type->get_primitive_type() == TYPE_BIGINT);
40
28
        DCHECK(!result_is_nullable);
41
279
    } else {
42
279
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
279
        DCHECK(result_is_nullable);
44
279
    }
45
46
307
    bool y_nullable_input = argument_types[0]->is_nullable();
47
307
    bool x_nullable_input = argument_types[1]->is_nullable();
48
307
    if (y_nullable_input) {
49
183
        if (x_nullable_input) {
50
112
            return creator_without_type::create_ignore_nullable<
51
112
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
112
                                                                          result_is_nullable, attr);
53
112
        } else {
54
71
            return creator_without_type::create_ignore_nullable<
55
71
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
71
                    argument_types, result_is_nullable, attr);
57
71
        }
58
183
    } else {
59
124
        if (x_nullable_input) {
60
51
            return creator_without_type::create_ignore_nullable<
61
51
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
51
                    argument_types, result_is_nullable, attr);
63
73
        } else {
64
73
            return creator_without_type::create_ignore_nullable<
65
73
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
73
                    argument_types, result_is_nullable, attr);
67
73
        }
68
124
    }
69
307
}
_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
68
                                                    const AggregateFunctionAttr& attr) {
35
68
    assert_arity_range(name, argument_types, 2, 2);
36
68
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
68
    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
68
    } else {
42
68
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
68
        DCHECK(result_is_nullable);
44
68
    }
45
46
68
    bool y_nullable_input = argument_types[0]->is_nullable();
47
68
    bool x_nullable_input = argument_types[1]->is_nullable();
48
68
    if (y_nullable_input) {
49
45
        if (x_nullable_input) {
50
26
            return creator_without_type::create_ignore_nullable<
51
26
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
26
                                                                          result_is_nullable, attr);
53
26
        } else {
54
19
            return creator_without_type::create_ignore_nullable<
55
19
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
19
                    argument_types, result_is_nullable, attr);
57
19
        }
58
45
    } else {
59
23
        if (x_nullable_input) {
60
9
            return creator_without_type::create_ignore_nullable<
61
9
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
9
                    argument_types, result_is_nullable, attr);
63
14
        } else {
64
14
            return creator_without_type::create_ignore_nullable<
65
14
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
14
                    argument_types, result_is_nullable, attr);
67
14
        }
68
23
    }
69
68
}
_ZN5doris30create_aggregate_function_regrILNS_16RegrFunctionKindE4EEESt10shared_ptrINS_18IAggregateFunctionEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS2_IKNS_9IDataTypeEESaISG_EERKSG_bRKNS_21AggregateFunctionAttrE
Line
Count
Source
34
68
                                                    const AggregateFunctionAttr& attr) {
35
68
    assert_arity_range(name, argument_types, 2, 2);
36
68
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
68
    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
68
    } else {
42
68
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
68
        DCHECK(result_is_nullable);
44
68
    }
45
46
68
    bool y_nullable_input = argument_types[0]->is_nullable();
47
68
    bool x_nullable_input = argument_types[1]->is_nullable();
48
68
    if (y_nullable_input) {
49
45
        if (x_nullable_input) {
50
26
            return creator_without_type::create_ignore_nullable<
51
26
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
26
                                                                          result_is_nullable, attr);
53
26
        } else {
54
19
            return creator_without_type::create_ignore_nullable<
55
19
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
19
                    argument_types, result_is_nullable, attr);
57
19
        }
58
45
    } else {
59
23
        if (x_nullable_input) {
60
9
            return creator_without_type::create_ignore_nullable<
61
9
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
9
                    argument_types, result_is_nullable, attr);
63
14
        } else {
64
14
            return creator_without_type::create_ignore_nullable<
65
14
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
14
                    argument_types, result_is_nullable, attr);
67
14
        }
68
23
    }
69
68
}
_ZN5doris30create_aggregate_function_regrILNS_16RegrFunctionKindE5EEESt10shared_ptrINS_18IAggregateFunctionEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS2_IKNS_9IDataTypeEESaISG_EERKSG_bRKNS_21AggregateFunctionAttrE
Line
Count
Source
34
15
                                                    const AggregateFunctionAttr& attr) {
35
15
    assert_arity_range(name, argument_types, 2, 2);
36
15
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
15
    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
15
    } else {
42
15
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
15
        DCHECK(result_is_nullable);
44
15
    }
45
46
15
    bool y_nullable_input = argument_types[0]->is_nullable();
47
15
    bool x_nullable_input = argument_types[1]->is_nullable();
48
15
    if (y_nullable_input) {
49
7
        if (x_nullable_input) {
50
4
            return creator_without_type::create_ignore_nullable<
51
4
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
4
                                                                          result_is_nullable, attr);
53
4
        } else {
54
3
            return creator_without_type::create_ignore_nullable<
55
3
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
3
                    argument_types, result_is_nullable, attr);
57
3
        }
58
8
    } else {
59
8
        if (x_nullable_input) {
60
3
            return creator_without_type::create_ignore_nullable<
61
3
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
3
                    argument_types, result_is_nullable, attr);
63
5
        } else {
64
5
            return creator_without_type::create_ignore_nullable<
65
5
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, false>>(
66
5
                    argument_types, result_is_nullable, attr);
67
5
        }
68
8
    }
69
15
}
_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
4
void register_aggregate_function_regr(AggregateFunctionSimpleFactory& factory) {
72
4
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_avgx>::name,
73
4
                                   create_aggregate_function_regr<RegrFunctionKind::regr_avgx>);
74
4
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_avgy>::name,
75
4
                                   create_aggregate_function_regr<RegrFunctionKind::regr_avgy>);
76
4
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_count>::name,
77
4
                                   create_aggregate_function_regr<RegrFunctionKind::regr_count>);
78
4
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_slope>::name,
79
4
                                   create_aggregate_function_regr<RegrFunctionKind::regr_slope>);
80
4
    factory.register_function_both(
81
4
            RegrTraits<RegrFunctionKind::regr_intercept>::name,
82
4
            create_aggregate_function_regr<RegrFunctionKind::regr_intercept>);
83
4
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_sxx>::name,
84
4
                                   create_aggregate_function_regr<RegrFunctionKind::regr_sxx>);
85
4
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_syy>::name,
86
4
                                   create_aggregate_function_regr<RegrFunctionKind::regr_syy>);
87
4
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_sxy>::name,
88
4
                                   create_aggregate_function_regr<RegrFunctionKind::regr_sxy>);
89
4
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_r2>::name,
90
4
                                   create_aggregate_function_regr<RegrFunctionKind::regr_r2>);
91
4
}
92
93
} // namespace doris