Coverage Report

Created: 2026-04-14 17:06

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exprs/aggregate/aggregate_function_covar.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_covar.h"
19
20
#include "core/data_type/data_type.h"
21
#include "exprs/aggregate/aggregate_function_simple_factory.h"
22
#include "exprs/aggregate/helpers.h"
23
24
namespace doris {
25
26
template <template <typename> class Function, template <PrimitiveType> class Data>
27
AggregateFunctionPtr create_function_single_value(const String& name,
28
                                                  const DataTypes& argument_types,
29
                                                  const bool result_is_nullable,
30
0
                                                  const AggregateFunctionAttr& attr) {
31
0
    return creator_with_type_list<TYPE_DOUBLE>::create<Function, Data>(argument_types,
32
0
                                                                       result_is_nullable, attr);
33
0
}
Unexecuted instantiation: _ZN5doris28create_function_single_valueINS_31AggregateFunctionSampCovarianceENS_8SampDataEEESt10shared_ptrINS_18IAggregateFunctionEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS3_IKNS_9IDataTypeEESaISH_EEbRKNS_21AggregateFunctionAttrE
Unexecuted instantiation: _ZN5doris28create_function_single_valueINS_31AggregateFunctionSampCovarianceENS_7PopDataEEESt10shared_ptrINS_18IAggregateFunctionEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorIS3_IKNS_9IDataTypeEESaISH_EEbRKNS_21AggregateFunctionAttrE
34
35
AggregateFunctionPtr create_aggregate_function_covariance_samp(const std::string& name,
36
                                                               const DataTypes& argument_types,
37
                                                               const DataTypePtr& result_type,
38
                                                               const bool result_is_nullable,
39
0
                                                               const AggregateFunctionAttr& attr) {
40
0
    return create_function_single_value<AggregateFunctionSampCovariance, SampData>(
41
0
            name, argument_types, result_is_nullable, attr);
42
0
}
43
44
AggregateFunctionPtr create_aggregate_function_covariance_pop(const std::string& name,
45
                                                              const DataTypes& argument_types,
46
                                                              const DataTypePtr& result_type,
47
                                                              const bool result_is_nullable,
48
0
                                                              const AggregateFunctionAttr& attr) {
49
0
    return create_function_single_value<AggregateFunctionSampCovariance, PopData>(
50
0
            name, argument_types, result_is_nullable, attr);
51
0
}
52
53
1
void register_aggregate_function_covar_pop(AggregateFunctionSimpleFactory& factory) {
54
1
    factory.register_function_both("covar", create_aggregate_function_covariance_pop);
55
1
    factory.register_alias("covar", "covar_pop");
56
1
}
57
58
1
void register_aggregate_function_covar_samp_old(AggregateFunctionSimpleFactory& factory) {
59
1
    BeExecVersionManager::registe_restrict_function_compatibility("covar_samp");
60
1
}
61
62
1
void register_aggregate_function_covar_samp(AggregateFunctionSimpleFactory& factory) {
63
1
    factory.register_function_both("covar_samp", create_aggregate_function_covariance_samp);
64
1
    register_aggregate_function_covar_samp_old(factory);
65
1
}
66
} // namespace doris