Coverage Report

Created: 2026-06-04 15:34

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
270
                                                    const AggregateFunctionAttr& attr) {
35
270
    assert_arity_range(name, argument_types, 2, 2);
36
270
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
270
    DCHECK(argument_types[1]->get_primitive_type() == TYPE_DOUBLE);
38
270
    if constexpr (kind == RegrFunctionKind::regr_count) {
39
18
        DCHECK(result_type->get_primitive_type() == TYPE_BIGINT);
40
18
        DCHECK(!result_is_nullable);
41
252
    } else {
42
252
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
252
        DCHECK(result_is_nullable);
44
252
    }
45
46
270
    bool y_nullable_input = argument_types[0]->is_nullable();
47
270
    bool x_nullable_input = argument_types[1]->is_nullable();
48
270
    if (y_nullable_input) {
49
161
        if (x_nullable_input) {
50
102
            return creator_without_type::create_ignore_nullable<
51
102
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
102
                                                                          result_is_nullable, attr);
53
102
        } else {
54
59
            return creator_without_type::create_ignore_nullable<
55
59
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, false>>(
56
59
                    argument_types, result_is_nullable, attr);
57
59
        }
58
161
    } else {
59
109
        if (x_nullable_input) {
60
43
            return creator_without_type::create_ignore_nullable<
61
43
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, false, true>>(
62
43
                    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
109
    }
69
270
}
_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
18
                                                    const AggregateFunctionAttr& attr) {
35
18
    assert_arity_range(name, argument_types, 2, 2);
36
18
    DCHECK(argument_types[0]->get_primitive_type() == TYPE_DOUBLE);
37
18
    DCHECK(argument_types[1]->get_primitive_type() == TYPE_DOUBLE);
38
18
    if constexpr (kind == RegrFunctionKind::regr_count) {
39
18
        DCHECK(result_type->get_primitive_type() == TYPE_BIGINT);
40
18
        DCHECK(!result_is_nullable);
41
    } else {
42
        DCHECK(result_type->get_primitive_type() == TYPE_DOUBLE);
43
        DCHECK(result_is_nullable);
44
    }
45
46
18
    bool y_nullable_input = argument_types[0]->is_nullable();
47
18
    bool x_nullable_input = argument_types[1]->is_nullable();
48
18
    if (y_nullable_input) {
49
10
        if (x_nullable_input) {
50
7
            return creator_without_type::create_ignore_nullable<
51
7
                    AggregateFunctionRegr<TYPE_DOUBLE, kind, true, true>>(argument_types,
52
7
                                                                          result_is_nullable, attr);
53
7
        } 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
10
    } 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
18
}
_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
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
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
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_16RegrFunctionKindE7EEESt10shared_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_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
3
void register_aggregate_function_regr(AggregateFunctionSimpleFactory& factory) {
72
3
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_avgx>::name,
73
3
                                   create_aggregate_function_regr<RegrFunctionKind::regr_avgx>);
74
3
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_avgy>::name,
75
3
                                   create_aggregate_function_regr<RegrFunctionKind::regr_avgy>);
76
3
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_count>::name,
77
3
                                   create_aggregate_function_regr<RegrFunctionKind::regr_count>);
78
3
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_slope>::name,
79
3
                                   create_aggregate_function_regr<RegrFunctionKind::regr_slope>);
80
3
    factory.register_function_both(
81
3
            RegrTraits<RegrFunctionKind::regr_intercept>::name,
82
3
            create_aggregate_function_regr<RegrFunctionKind::regr_intercept>);
83
3
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_sxx>::name,
84
3
                                   create_aggregate_function_regr<RegrFunctionKind::regr_sxx>);
85
3
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_syy>::name,
86
3
                                   create_aggregate_function_regr<RegrFunctionKind::regr_syy>);
87
3
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_sxy>::name,
88
3
                                   create_aggregate_function_regr<RegrFunctionKind::regr_sxy>);
89
3
    factory.register_function_both(RegrTraits<RegrFunctionKind::regr_r2>::name,
90
3
                                   create_aggregate_function_regr<RegrFunctionKind::regr_r2>);
91
3
}
92
93
} // namespace doris