Coverage Report

Created: 2026-03-15 08:11

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exprs/aggregate/aggregate_function_map_v2.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_map_v2.h"
19
20
#include "exprs/aggregate/helpers.h"
21
22
namespace doris {
23
#include "common/compile_check_begin.h"
24
25
AggregateFunctionPtr create_agg_function_map_agg_v2(const DataTypes& argument_types,
26
                                                    const bool result_is_nullable,
27
0
                                                    const AggregateFunctionAttr& attr) {
28
0
    return creator_without_type::create_ignore_nullable<
29
0
            AggregateFunctionMapAggV2<AggregateFunctionMapAggDataV2>>(argument_types,
30
0
                                                                      result_is_nullable, attr);
31
0
}
32
33
AggregateFunctionPtr create_aggregate_function_map_agg_v2(const std::string& name,
34
                                                          const DataTypes& argument_types,
35
                                                          const DataTypePtr& result_type,
36
                                                          const bool result_is_nullable,
37
0
                                                          const AggregateFunctionAttr& attr) {
38
0
    switch (argument_types[0]->get_primitive_type()) {
39
0
    case PrimitiveType::TYPE_BOOLEAN:
40
0
    case PrimitiveType::TYPE_TINYINT:
41
0
    case PrimitiveType::TYPE_SMALLINT:
42
0
    case PrimitiveType::TYPE_INT:
43
0
    case PrimitiveType::TYPE_BIGINT:
44
0
    case PrimitiveType::TYPE_LARGEINT:
45
0
    case PrimitiveType::TYPE_FLOAT:
46
0
    case PrimitiveType::TYPE_DOUBLE:
47
0
    case PrimitiveType::TYPE_DECIMAL32:
48
0
    case PrimitiveType::TYPE_DECIMAL64:
49
0
    case PrimitiveType::TYPE_DECIMAL128I:
50
0
    case PrimitiveType::TYPE_DECIMALV2:
51
0
    case PrimitiveType::TYPE_DECIMAL256:
52
0
    case PrimitiveType::TYPE_STRING:
53
0
    case PrimitiveType::TYPE_CHAR:
54
0
    case PrimitiveType::TYPE_VARCHAR:
55
0
    case PrimitiveType::TYPE_DATEV2:
56
0
    case PrimitiveType::TYPE_DATETIMEV2:
57
0
    case PrimitiveType::TYPE_TIMEV2:
58
0
        return create_agg_function_map_agg_v2(argument_types, result_is_nullable, attr);
59
0
    default:
60
0
        LOG(WARNING) << fmt::format("unsupported input type {} for aggregate function {}",
61
0
                                    argument_types[0]->get_name(), name);
62
0
        return nullptr;
63
0
    }
64
0
}
65
66
1
void register_aggregate_function_map_agg_v2(AggregateFunctionSimpleFactory& factory) {
67
1
    factory.register_function_both("map_agg_v2", create_aggregate_function_map_agg_v2);
68
1
}
69
70
} // namespace doris