be/src/exprs/aggregate/aggregate_function_window_funnel.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_window_funnel.h" |
19 | | |
20 | | #include <string> |
21 | | |
22 | | #include "common/logging.h" |
23 | | #include "core/data_type/data_type.h" |
24 | | #include "core/types.h" |
25 | | #include "exprs/aggregate/aggregate_function_simple_factory.h" |
26 | | #include "exprs/aggregate/helpers.h" |
27 | | |
28 | | namespace doris { |
29 | | #include "common/compile_check_begin.h" |
30 | | |
31 | | AggregateFunctionPtr create_aggregate_function_window_funnel(const std::string& name, |
32 | | const DataTypes& argument_types, |
33 | | const DataTypePtr& result_type, |
34 | | const bool result_is_nullable, |
35 | 6 | const AggregateFunctionAttr& attr) { |
36 | 6 | if (argument_types.size() < 3) { |
37 | 0 | LOG(WARNING) << "window_funnel's argument less than 3."; |
38 | 0 | return nullptr; |
39 | 0 | } |
40 | 6 | if (argument_types[2]->get_primitive_type() == TYPE_DATETIMEV2) { |
41 | 6 | return creator_without_type::create<AggregateFunctionWindowFunnel>( |
42 | 6 | argument_types, result_is_nullable, attr); |
43 | 6 | } else { |
44 | 0 | LOG(WARNING) << "Only support DateTime type as window argument!"; |
45 | 0 | return nullptr; |
46 | 0 | } |
47 | 6 | } |
48 | | |
49 | 1 | void register_aggregate_function_window_funnel(AggregateFunctionSimpleFactory& factory) { |
50 | 1 | factory.register_function_both("window_funnel", create_aggregate_function_window_funnel); |
51 | 1 | } |
52 | 1 | void register_aggregate_function_window_funnel_old(AggregateFunctionSimpleFactory& factory) { |
53 | 1 | BeExecVersionManager::registe_restrict_function_compatibility("window_funnel"); |
54 | 1 | } |
55 | | } // namespace doris |