Coverage Report

Created: 2026-04-10 04:05

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