be/src/exprs/function/function_fake.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/function/function_fake.h" |
19 | | |
20 | | #include <glog/logging.h> |
21 | | |
22 | | #include <algorithm> |
23 | | #include <boost/iterator/iterator_facade.hpp> |
24 | | #include <memory> |
25 | | #include <ostream> |
26 | | #include <string> |
27 | | |
28 | | #include "core/data_type/data_type_array.h" |
29 | | #include "core/data_type/data_type_jsonb.h" |
30 | | #include "core/data_type/data_type_map.h" |
31 | | #include "core/data_type/data_type_nullable.h" |
32 | | #include "core/data_type/data_type_number.h" |
33 | | #include "core/data_type/data_type_string.h" |
34 | | #include "core/data_type/data_type_struct.h" |
35 | | #include "core/data_type/data_type_variant.h" |
36 | | #include "exprs/aggregate/aggregate_function.h" |
37 | | #include "exprs/function/function_helpers.h" |
38 | | #include "exprs/function/simple_function_factory.h" |
39 | | #include "exprs/table_function/table_function.h" |
40 | | |
41 | | namespace doris { |
42 | | |
43 | | template <typename ReturnType, bool AlwaysNullable = false, bool VARIADIC = false> |
44 | | struct FunctionFakeBaseImpl { |
45 | 0 | static DataTypePtr get_return_type_impl(const DataTypes& arguments) { |
46 | 0 | if constexpr (AlwaysNullable) { |
47 | 0 | return make_nullable(std::make_shared<ReturnType>()); |
48 | 0 | } |
49 | 0 | return std::make_shared<ReturnType>(); |
50 | 0 | } Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE2EEELb0ELb0EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS9_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeStringELb0ELb0EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeStringELb1ELb0EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEELb0ELb0EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS9_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEELb1ELb0EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS9_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEELb0ELb0EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS9_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEELb1ELb0EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS9_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_13DataTypeJsonbELb0ELb1EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_13DataTypeJsonbELb1ELb1EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeStringELb0ELb1EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeStringELb1ELb1EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEELb0ELb0EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS9_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEELb1ELb0EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS9_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_15DataTypeVariantELb0ELb0EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_15DataTypeVariantELb1ELb0EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE |
51 | 18 | static DataTypes get_variadic_argument_types() { |
52 | 18 | if constexpr (VARIADIC) { |
53 | 4 | return {std::make_shared<ReturnType>()}; |
54 | 14 | } else { |
55 | 14 | return {}; |
56 | 14 | } |
57 | 18 | } _ZN5doris20FunctionFakeBaseImplINS_14DataTypeStringELb0ELb0EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 2 | static DataTypes get_variadic_argument_types() { | 52 | | if constexpr (VARIADIC) { | 53 | | return {std::make_shared<ReturnType>()}; | 54 | 2 | } else { | 55 | 2 | return {}; | 56 | 2 | } | 57 | 2 | } |
_ZN5doris20FunctionFakeBaseImplINS_14DataTypeStringELb1ELb0EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 2 | static DataTypes get_variadic_argument_types() { | 52 | | if constexpr (VARIADIC) { | 53 | | return {std::make_shared<ReturnType>()}; | 54 | 2 | } else { | 55 | 2 | return {}; | 56 | 2 | } | 57 | 2 | } |
_ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEELb0ELb0EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 1 | static DataTypes get_variadic_argument_types() { | 52 | | if constexpr (VARIADIC) { | 53 | | return {std::make_shared<ReturnType>()}; | 54 | 1 | } else { | 55 | 1 | return {}; | 56 | 1 | } | 57 | 1 | } |
_ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEELb1ELb0EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 1 | static DataTypes get_variadic_argument_types() { | 52 | | if constexpr (VARIADIC) { | 53 | | return {std::make_shared<ReturnType>()}; | 54 | 1 | } else { | 55 | 1 | return {}; | 56 | 1 | } | 57 | 1 | } |
_ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEELb0ELb0EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 2 | static DataTypes get_variadic_argument_types() { | 52 | | if constexpr (VARIADIC) { | 53 | | return {std::make_shared<ReturnType>()}; | 54 | 2 | } else { | 55 | 2 | return {}; | 56 | 2 | } | 57 | 2 | } |
_ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEELb1ELb0EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 2 | static DataTypes get_variadic_argument_types() { | 52 | | if constexpr (VARIADIC) { | 53 | | return {std::make_shared<ReturnType>()}; | 54 | 2 | } else { | 55 | 2 | return {}; | 56 | 2 | } | 57 | 2 | } |
_ZN5doris20FunctionFakeBaseImplINS_13DataTypeJsonbELb0ELb1EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 1 | static DataTypes get_variadic_argument_types() { | 52 | 1 | if constexpr (VARIADIC) { | 53 | 1 | return {std::make_shared<ReturnType>()}; | 54 | | } else { | 55 | | return {}; | 56 | | } | 57 | 1 | } |
_ZN5doris20FunctionFakeBaseImplINS_13DataTypeJsonbELb1ELb1EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 1 | static DataTypes get_variadic_argument_types() { | 52 | 1 | if constexpr (VARIADIC) { | 53 | 1 | return {std::make_shared<ReturnType>()}; | 54 | | } else { | 55 | | return {}; | 56 | | } | 57 | 1 | } |
_ZN5doris20FunctionFakeBaseImplINS_14DataTypeStringELb0ELb1EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 1 | static DataTypes get_variadic_argument_types() { | 52 | 1 | if constexpr (VARIADIC) { | 53 | 1 | return {std::make_shared<ReturnType>()}; | 54 | | } else { | 55 | | return {}; | 56 | | } | 57 | 1 | } |
_ZN5doris20FunctionFakeBaseImplINS_14DataTypeStringELb1ELb1EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 1 | static DataTypes get_variadic_argument_types() { | 52 | 1 | if constexpr (VARIADIC) { | 53 | 1 | return {std::make_shared<ReturnType>()}; | 54 | | } else { | 55 | | return {}; | 56 | | } | 57 | 1 | } |
_ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEELb0ELb0EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 1 | static DataTypes get_variadic_argument_types() { | 52 | | if constexpr (VARIADIC) { | 53 | | return {std::make_shared<ReturnType>()}; | 54 | 1 | } else { | 55 | 1 | return {}; | 56 | 1 | } | 57 | 1 | } |
_ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEELb1ELb0EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 1 | static DataTypes get_variadic_argument_types() { | 52 | | if constexpr (VARIADIC) { | 53 | | return {std::make_shared<ReturnType>()}; | 54 | 1 | } else { | 55 | 1 | return {}; | 56 | 1 | } | 57 | 1 | } |
_ZN5doris20FunctionFakeBaseImplINS_15DataTypeVariantELb0ELb0EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 1 | static DataTypes get_variadic_argument_types() { | 52 | | if constexpr (VARIADIC) { | 53 | | return {std::make_shared<ReturnType>()}; | 54 | 1 | } else { | 55 | 1 | return {}; | 56 | 1 | } | 57 | 1 | } |
_ZN5doris20FunctionFakeBaseImplINS_15DataTypeVariantELb1ELb0EE27get_variadic_argument_typesEv Line | Count | Source | 51 | 1 | static DataTypes get_variadic_argument_types() { | 52 | | if constexpr (VARIADIC) { | 53 | | return {std::make_shared<ReturnType>()}; | 54 | 1 | } else { | 55 | 1 | return {}; | 56 | 1 | } | 57 | 1 | } |
|
58 | 0 | static std::string get_error_msg() { return "Fake function do not support execute"; }Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeStringELb0ELb0EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeStringELb1ELb0EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEELb0ELb0EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEELb1ELb0EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEELb0ELb0EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEELb1ELb0EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_13DataTypeJsonbELb0ELb1EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_13DataTypeJsonbELb1ELb1EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeStringELb0ELb1EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeStringELb1ELb1EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEELb0ELb0EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEELb1ELb0EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_15DataTypeVariantELb0ELb0EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris20FunctionFakeBaseImplINS_15DataTypeVariantELb1ELb0EE13get_error_msgB5cxx11Ev |
59 | | }; |
60 | | |
61 | | struct FunctionExplode { |
62 | 0 | static DataTypePtr get_return_type_impl(const DataTypes& arguments) { |
63 | 0 | DORIS_CHECK(arguments[0]->get_primitive_type() == TYPE_ARRAY); |
64 | 0 | return make_nullable( |
65 | 0 | check_and_get_data_type<DataTypeArray>(arguments[0].get())->get_nested_type()); |
66 | 0 | } |
67 | 2 | static DataTypes get_variadic_argument_types() { return {}; } |
68 | 0 | static std::string get_error_msg() { return "Fake function do not support execute"; } |
69 | | }; |
70 | | |
71 | | struct FunctionExplodeV2 { |
72 | 2 | static DataTypePtr get_return_type_impl(const DataTypes& arguments) { |
73 | 2 | DataTypes fieldTypes(arguments.size()); |
74 | 4 | for (int i = 0; i < arguments.size(); i++) { |
75 | 2 | if (arguments[i]->get_primitive_type() == PrimitiveType::TYPE_VARIANT) { |
76 | 0 | if (arguments[i]->is_nullable()) { |
77 | 0 | fieldTypes[i] = arguments[i]; |
78 | 0 | } else { |
79 | 0 | fieldTypes[i] = make_nullable(arguments[i]); |
80 | 0 | } |
81 | 2 | } else { |
82 | 2 | auto nestedType = check_and_get_data_type<DataTypeArray>(arguments[i].get()) |
83 | 2 | ->get_nested_type(); |
84 | 2 | if (nestedType->is_nullable()) { |
85 | 2 | fieldTypes[i] = nestedType; |
86 | 2 | } else { |
87 | 0 | fieldTypes[i] = make_nullable(nestedType); |
88 | 0 | } |
89 | 2 | } |
90 | 2 | } |
91 | | |
92 | 2 | if (fieldTypes.size() > 1) { |
93 | 0 | return make_nullable(std::make_shared<DataTypeStruct>(fieldTypes)); |
94 | 2 | } else { |
95 | 2 | return make_nullable(fieldTypes[0]); |
96 | 2 | } |
97 | 2 | } |
98 | 3 | static DataTypes get_variadic_argument_types() { return {}; } |
99 | 0 | static std::string get_error_msg() { return "Fake function do not support execute"; } |
100 | | }; |
101 | | |
102 | | // explode map: make map k,v as struct field |
103 | | struct FunctionExplodeMap { |
104 | 0 | static DataTypePtr get_return_type_impl(const DataTypes& arguments) { |
105 | 0 | DORIS_CHECK(arguments[0]->get_primitive_type() == TYPE_MAP); |
106 | 0 | DataTypes fieldTypes(2); |
107 | 0 | fieldTypes[0] = check_and_get_data_type<DataTypeMap>(arguments[0].get())->get_key_type(); |
108 | 0 | fieldTypes[1] = check_and_get_data_type<DataTypeMap>(arguments[0].get())->get_value_type(); |
109 | 0 | return make_nullable(std::make_shared<DataTypeStruct>(fieldTypes)); |
110 | 0 | } |
111 | 2 | static DataTypes get_variadic_argument_types() { return {}; } |
112 | 0 | static std::string get_error_msg() { return "Fake function do not support execute"; } |
113 | | }; |
114 | | |
115 | | template <bool AlwaysNullable = false> |
116 | | struct FunctionPoseExplode { |
117 | 0 | static DataTypePtr get_return_type_impl(const DataTypes& arguments) { |
118 | 0 | DataTypes fieldTypes(arguments.size() + 1); |
119 | 0 | fieldTypes[0] = std::make_shared<DataTypeInt32>(); |
120 | 0 | for (int i = 0; i < arguments.size(); i++) { |
121 | 0 | DORIS_CHECK(arguments[i]->get_primitive_type() == TYPE_ARRAY); |
122 | 0 | auto nestedType = |
123 | 0 | check_and_get_data_type<DataTypeArray>(arguments[i].get())->get_nested_type(); |
124 | 0 | fieldTypes[i + 1] = make_nullable(nestedType); |
125 | 0 | } |
126 | 0 | auto struct_type = std::make_shared<DataTypeStruct>(fieldTypes); |
127 | 0 | if constexpr (AlwaysNullable) { |
128 | 0 | return make_nullable(struct_type); |
129 | 0 | } else { |
130 | 0 | return struct_type; |
131 | 0 | } |
132 | 0 | } Unexecuted instantiation: _ZN5doris19FunctionPoseExplodeILb0EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS6_EE Unexecuted instantiation: _ZN5doris19FunctionPoseExplodeILb1EE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS6_EE |
133 | 2 | static DataTypes get_variadic_argument_types() { return {}; }_ZN5doris19FunctionPoseExplodeILb0EE27get_variadic_argument_typesEv Line | Count | Source | 133 | 1 | static DataTypes get_variadic_argument_types() { return {}; } |
_ZN5doris19FunctionPoseExplodeILb1EE27get_variadic_argument_typesEv Line | Count | Source | 133 | 1 | static DataTypes get_variadic_argument_types() { return {}; } |
|
134 | 0 | static std::string get_error_msg() { return "Fake function do not support execute"; }Unexecuted instantiation: _ZN5doris19FunctionPoseExplodeILb0EE13get_error_msgB5cxx11Ev Unexecuted instantiation: _ZN5doris19FunctionPoseExplodeILb1EE13get_error_msgB5cxx11Ev |
135 | | }; |
136 | | |
137 | | // explode json-object: expands json-object to struct with a pair of key and value in column string |
138 | | struct FunctionExplodeJsonObject { |
139 | 0 | static DataTypePtr get_return_type_impl(const DataTypes& arguments) { |
140 | 0 | DORIS_CHECK(arguments[0]->get_primitive_type() == PrimitiveType::TYPE_JSONB); |
141 | 0 | DataTypes fieldTypes(2); |
142 | 0 | fieldTypes[0] = make_nullable(std::make_shared<DataTypeString>()); |
143 | 0 | fieldTypes[1] = make_nullable(std::make_shared<DataTypeJsonb>()); |
144 | 0 | return make_nullable(std::make_shared<DataTypeStruct>(fieldTypes)); |
145 | 0 | } |
146 | 2 | static DataTypes get_variadic_argument_types() { return {}; } |
147 | 0 | static std::string get_error_msg() { return "Fake function do not support execute"; } |
148 | | }; |
149 | | |
150 | | // json_each(json) -> Nullable(Struct(key Nullable(String), value Nullable(JSONB))) |
151 | | struct FunctionJsonEach { |
152 | 0 | static DataTypePtr get_return_type_impl(const DataTypes& arguments) { |
153 | 0 | DORIS_CHECK(arguments[0]->get_primitive_type() == PrimitiveType::TYPE_JSONB); |
154 | 0 | DataTypes fieldTypes(2); |
155 | 0 | fieldTypes[0] = make_nullable(std::make_shared<DataTypeString>()); |
156 | 0 | fieldTypes[1] = make_nullable(std::make_shared<DataTypeJsonb>()); |
157 | 0 | return make_nullable(std::make_shared<DataTypeStruct>(fieldTypes)); |
158 | 0 | } |
159 | 2 | static DataTypes get_variadic_argument_types() { return {}; } |
160 | 0 | static std::string get_error_msg() { return "Fake function do not support execute"; } |
161 | | }; |
162 | | |
163 | | // json_each_text(json) -> Nullable(Struct(key Nullable(String), value Nullable(String))) |
164 | | struct FunctionJsonEachText { |
165 | 0 | static DataTypePtr get_return_type_impl(const DataTypes& arguments) { |
166 | 0 | DORIS_CHECK(arguments[0]->get_primitive_type() == PrimitiveType::TYPE_JSONB); |
167 | 0 | DataTypes fieldTypes(2); |
168 | 0 | fieldTypes[0] = make_nullable(std::make_shared<DataTypeString>()); |
169 | 0 | fieldTypes[1] = make_nullable(std::make_shared<DataTypeString>()); |
170 | 0 | return make_nullable(std::make_shared<DataTypeStruct>(fieldTypes)); |
171 | 0 | } |
172 | 2 | static DataTypes get_variadic_argument_types() { return {}; } |
173 | 0 | static std::string get_error_msg() { return "Fake function do not support execute"; } |
174 | | }; |
175 | | |
176 | | struct FunctionEsquery { |
177 | 0 | static DataTypePtr get_return_type_impl(const DataTypes& arguments) { |
178 | 0 | return FunctionFakeBaseImpl<DataTypeUInt8>::get_return_type_impl(arguments); |
179 | 0 | } |
180 | 1 | static DataTypes get_variadic_argument_types() { return {}; } |
181 | 0 | static std::string get_error_msg() { return "esquery only supported on es table"; } |
182 | | }; |
183 | | |
184 | | template <typename FunctionImpl> |
185 | 1 | void register_function(SimpleFunctionFactory& factory, const std::string& name) { |
186 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name); |
187 | 1 | }; |
188 | | |
189 | | template <typename FunctionImpl> |
190 | | void register_table_function_expand(SimpleFunctionFactory& factory, const std::string& name, |
191 | 5 | const std::string& suffix) { |
192 | 5 | factory.register_function<FunctionFake<FunctionImpl>>(name); |
193 | 5 | factory.register_function<FunctionFake<FunctionImpl>>(name + suffix); |
194 | 5 | }; _ZN5doris30register_table_function_expandINS_17FunctionExplodeV2EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESB_ Line | Count | Source | 191 | 1 | const std::string& suffix) { | 192 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name); | 193 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name + suffix); | 194 | 1 | }; |
_ZN5doris30register_table_function_expandINS_18FunctionExplodeMapEEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESB_ Line | Count | Source | 191 | 1 | const std::string& suffix) { | 192 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name); | 193 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name + suffix); | 194 | 1 | }; |
_ZN5doris30register_table_function_expandINS_25FunctionExplodeJsonObjectEEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESB_ Line | Count | Source | 191 | 1 | const std::string& suffix) { | 192 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name); | 193 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name + suffix); | 194 | 1 | }; |
_ZN5doris30register_table_function_expandINS_16FunctionJsonEachEEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESB_ Line | Count | Source | 191 | 1 | const std::string& suffix) { | 192 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name); | 193 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name + suffix); | 194 | 1 | }; |
_ZN5doris30register_table_function_expandINS_20FunctionJsonEachTextEEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESB_ Line | Count | Source | 191 | 1 | const std::string& suffix) { | 192 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name); | 193 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name + suffix); | 194 | 1 | }; |
|
195 | | |
196 | | template <typename FunctionImpl> |
197 | | void register_table_alternative_function_expand(SimpleFunctionFactory& factory, |
198 | | const std::string& name, |
199 | 1 | const std::string& suffix) { |
200 | 1 | factory.register_alternative_function<FunctionFake<FunctionImpl>>(name); |
201 | 1 | factory.register_alternative_function<FunctionFake<FunctionImpl>>(name + suffix); |
202 | 1 | }; |
203 | | |
204 | | template <typename ReturnType, bool VARIADIC> |
205 | | void register_table_function_expand_default(SimpleFunctionFactory& factory, const std::string& name, |
206 | 8 | const std::string& suffix) { |
207 | 8 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, false, VARIADIC>>>( |
208 | 8 | name); |
209 | 8 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, true, VARIADIC>>>( |
210 | 8 | name + suffix); |
211 | 8 | }; _ZN5doris38register_table_function_expand_defaultINS_14DataTypeStringELb0EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESB_ Line | Count | Source | 206 | 2 | const std::string& suffix) { | 207 | 2 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, false, VARIADIC>>>( | 208 | 2 | name); | 209 | 2 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, true, VARIADIC>>>( | 210 | 2 | name + suffix); | 211 | 2 | }; |
_ZN5doris38register_table_function_expand_defaultINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEELb0EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESD_ Line | Count | Source | 206 | 1 | const std::string& suffix) { | 207 | 1 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, false, VARIADIC>>>( | 208 | 1 | name); | 209 | 1 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, true, VARIADIC>>>( | 210 | 1 | name + suffix); | 211 | 1 | }; |
_ZN5doris38register_table_function_expand_defaultINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEELb0EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESD_ Line | Count | Source | 206 | 2 | const std::string& suffix) { | 207 | 2 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, false, VARIADIC>>>( | 208 | 2 | name); | 209 | 2 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, true, VARIADIC>>>( | 210 | 2 | name + suffix); | 211 | 2 | }; |
_ZN5doris38register_table_function_expand_defaultINS_13DataTypeJsonbELb1EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESB_ Line | Count | Source | 206 | 1 | const std::string& suffix) { | 207 | 1 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, false, VARIADIC>>>( | 208 | 1 | name); | 209 | 1 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, true, VARIADIC>>>( | 210 | 1 | name + suffix); | 211 | 1 | }; |
_ZN5doris38register_table_function_expand_defaultINS_14DataTypeStringELb1EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESB_ Line | Count | Source | 206 | 1 | const std::string& suffix) { | 207 | 1 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, false, VARIADIC>>>( | 208 | 1 | name); | 209 | 1 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, true, VARIADIC>>>( | 210 | 1 | name + suffix); | 211 | 1 | }; |
_ZN5doris38register_table_function_expand_defaultINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEELb0EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESD_ Line | Count | Source | 206 | 1 | const std::string& suffix) { | 207 | 1 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, false, VARIADIC>>>( | 208 | 1 | name); | 209 | 1 | factory.register_function<FunctionFake<FunctionFakeBaseImpl<ReturnType, true, VARIADIC>>>( | 210 | 1 | name + suffix); | 211 | 1 | }; |
|
212 | | |
213 | | template <typename ReturnType, bool VARIADIC> |
214 | | void register_table_alternative_function_expand_default(SimpleFunctionFactory& factory, |
215 | | const std::string& name, |
216 | 1 | const std::string& suffix) { |
217 | 1 | factory.register_alternative_function< |
218 | 1 | FunctionFake<FunctionFakeBaseImpl<ReturnType, false, VARIADIC>>>(name); |
219 | 1 | factory.register_alternative_function< |
220 | 1 | FunctionFake<FunctionFakeBaseImpl<ReturnType, true, VARIADIC>>>(name + suffix); |
221 | 1 | }; |
222 | | |
223 | | template <typename FunctionImpl> |
224 | 5 | void register_table_function_expand_outer(SimpleFunctionFactory& factory, const std::string& name) { |
225 | 5 | register_table_function_expand<FunctionImpl>(factory, name, COMBINATOR_SUFFIX_OUTER); |
226 | 5 | }; _ZN5doris36register_table_function_expand_outerINS_17FunctionExplodeV2EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 224 | 1 | void register_table_function_expand_outer(SimpleFunctionFactory& factory, const std::string& name) { | 225 | 1 | register_table_function_expand<FunctionImpl>(factory, name, COMBINATOR_SUFFIX_OUTER); | 226 | 1 | }; |
_ZN5doris36register_table_function_expand_outerINS_18FunctionExplodeMapEEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 224 | 1 | void register_table_function_expand_outer(SimpleFunctionFactory& factory, const std::string& name) { | 225 | 1 | register_table_function_expand<FunctionImpl>(factory, name, COMBINATOR_SUFFIX_OUTER); | 226 | 1 | }; |
_ZN5doris36register_table_function_expand_outerINS_25FunctionExplodeJsonObjectEEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 224 | 1 | void register_table_function_expand_outer(SimpleFunctionFactory& factory, const std::string& name) { | 225 | 1 | register_table_function_expand<FunctionImpl>(factory, name, COMBINATOR_SUFFIX_OUTER); | 226 | 1 | }; |
_ZN5doris36register_table_function_expand_outerINS_16FunctionJsonEachEEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 224 | 1 | void register_table_function_expand_outer(SimpleFunctionFactory& factory, const std::string& name) { | 225 | 1 | register_table_function_expand<FunctionImpl>(factory, name, COMBINATOR_SUFFIX_OUTER); | 226 | 1 | }; |
_ZN5doris36register_table_function_expand_outerINS_20FunctionJsonEachTextEEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 224 | 1 | void register_table_function_expand_outer(SimpleFunctionFactory& factory, const std::string& name) { | 225 | 1 | register_table_function_expand<FunctionImpl>(factory, name, COMBINATOR_SUFFIX_OUTER); | 226 | 1 | }; |
|
227 | | |
228 | | template <typename FunctionImpl> |
229 | | void register_table_alternative_function_expand_outer(SimpleFunctionFactory& factory, |
230 | 1 | const std::string& name) { |
231 | 1 | register_table_alternative_function_expand<FunctionImpl>(factory, name, |
232 | 1 | COMBINATOR_SUFFIX_OUTER); |
233 | 1 | }; |
234 | | |
235 | | template <typename ReturnType, bool VARIADIC> |
236 | | void register_table_function_expand_outer_default(SimpleFunctionFactory& factory, |
237 | 8 | const std::string& name) { |
238 | 8 | register_table_function_expand_default<ReturnType, VARIADIC>(factory, name, |
239 | 8 | COMBINATOR_SUFFIX_OUTER); |
240 | 8 | }; _ZN5doris44register_table_function_expand_outer_defaultINS_14DataTypeStringELb0EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 237 | 2 | const std::string& name) { | 238 | 2 | register_table_function_expand_default<ReturnType, VARIADIC>(factory, name, | 239 | 2 | COMBINATOR_SUFFIX_OUTER); | 240 | 2 | }; |
_ZN5doris44register_table_function_expand_outer_defaultINS_14DataTypeNumberILNS_13PrimitiveTypeE5EEELb0EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 237 | 1 | const std::string& name) { | 238 | 1 | register_table_function_expand_default<ReturnType, VARIADIC>(factory, name, | 239 | 1 | COMBINATOR_SUFFIX_OUTER); | 240 | 1 | }; |
_ZN5doris44register_table_function_expand_outer_defaultINS_14DataTypeNumberILNS_13PrimitiveTypeE6EEELb0EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 237 | 2 | const std::string& name) { | 238 | 2 | register_table_function_expand_default<ReturnType, VARIADIC>(factory, name, | 239 | 2 | COMBINATOR_SUFFIX_OUTER); | 240 | 2 | }; |
_ZN5doris44register_table_function_expand_outer_defaultINS_13DataTypeJsonbELb1EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 237 | 1 | const std::string& name) { | 238 | 1 | register_table_function_expand_default<ReturnType, VARIADIC>(factory, name, | 239 | 1 | COMBINATOR_SUFFIX_OUTER); | 240 | 1 | }; |
_ZN5doris44register_table_function_expand_outer_defaultINS_14DataTypeStringELb1EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 237 | 1 | const std::string& name) { | 238 | 1 | register_table_function_expand_default<ReturnType, VARIADIC>(factory, name, | 239 | 1 | COMBINATOR_SUFFIX_OUTER); | 240 | 1 | }; |
_ZN5doris44register_table_function_expand_outer_defaultINS_14DataTypeNumberILNS_13PrimitiveTypeE9EEELb0EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 237 | 1 | const std::string& name) { | 238 | 1 | register_table_function_expand_default<ReturnType, VARIADIC>(factory, name, | 239 | 1 | COMBINATOR_SUFFIX_OUTER); | 240 | 1 | }; |
|
241 | | |
242 | | template <typename ReturnType, bool VARIADIC> |
243 | | void register_table_alternative_function_expand_outer_default(SimpleFunctionFactory& factory, |
244 | 1 | const std::string& name) { |
245 | 1 | register_table_alternative_function_expand_default<ReturnType, VARIADIC>( |
246 | 1 | factory, name, COMBINATOR_SUFFIX_OUTER); |
247 | 1 | }; |
248 | | |
249 | | template <typename FunctionImpl> |
250 | | void register_table_function_with_impl(SimpleFunctionFactory& factory, const std::string& name, |
251 | 3 | const std::string& suffix = "") { |
252 | 3 | factory.register_function<FunctionFake<FunctionImpl>>(name + suffix); |
253 | 3 | }; _ZN5doris33register_table_function_with_implINS_19FunctionPoseExplodeILb0EEEEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESC_ Line | Count | Source | 251 | 1 | const std::string& suffix = "") { | 252 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name + suffix); | 253 | 1 | }; |
_ZN5doris33register_table_function_with_implINS_19FunctionPoseExplodeILb1EEEEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESC_ Line | Count | Source | 251 | 1 | const std::string& suffix = "") { | 252 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name + suffix); | 253 | 1 | }; |
_ZN5doris33register_table_function_with_implINS_17FunctionExplodeV2EEEvRNS_21SimpleFunctionFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESB_ Line | Count | Source | 251 | 1 | const std::string& suffix = "") { | 252 | 1 | factory.register_function<FunctionFake<FunctionImpl>>(name + suffix); | 253 | 1 | }; |
|
254 | | |
255 | 1 | void register_function_fake(SimpleFunctionFactory& factory) { |
256 | 1 | register_function<FunctionEsquery>(factory, "esquery"); |
257 | | |
258 | 1 | register_table_function_expand_outer<FunctionExplodeV2>(factory, "explode"); |
259 | 1 | register_table_alternative_function_expand_outer<FunctionExplode>(factory, "explode"); |
260 | | |
261 | 1 | register_table_function_expand_outer<FunctionExplodeMap>(factory, "explode_map"); |
262 | | |
263 | 1 | register_table_function_expand_outer<FunctionExplodeJsonObject>(factory, "explode_json_object"); |
264 | 1 | register_table_function_expand_outer<FunctionJsonEach>(factory, "json_each"); |
265 | 1 | register_table_function_expand_outer<FunctionJsonEachText>(factory, "json_each_text"); |
266 | 1 | register_table_function_expand_outer_default<DataTypeString, false>(factory, "explode_split"); |
267 | 1 | register_table_function_expand_outer_default<DataTypeInt32, false>(factory, "explode_numbers"); |
268 | 1 | register_table_function_expand_outer_default<DataTypeInt64, false>(factory, |
269 | 1 | "explode_json_array_int"); |
270 | 1 | register_table_function_expand_outer_default<DataTypeString, false>( |
271 | 1 | factory, "explode_json_array_string"); |
272 | 1 | register_table_function_expand_outer_default<DataTypeJsonb, true>(factory, |
273 | 1 | "explode_json_array_json"); |
274 | 1 | register_table_function_expand_outer_default<DataTypeString, true>(factory, |
275 | 1 | "explode_json_array_json"); |
276 | 1 | register_table_function_expand_outer_default<DataTypeFloat64, false>( |
277 | 1 | factory, "explode_json_array_double"); |
278 | 1 | register_table_function_expand_outer_default<DataTypeInt64, false>(factory, "explode_bitmap"); |
279 | 1 | register_table_function_with_impl<FunctionPoseExplode<false>>(factory, "posexplode"); |
280 | 1 | register_table_function_with_impl<FunctionPoseExplode<true>>(factory, "posexplode", |
281 | 1 | COMBINATOR_SUFFIX_OUTER); |
282 | 1 | register_table_alternative_function_expand_outer_default<DataTypeVariant, false>( |
283 | 1 | factory, "explode_variant_array"); |
284 | 1 | register_table_function_with_impl<FunctionExplodeV2>(factory, "explode_variant_array"); |
285 | 1 | } |
286 | | |
287 | | } // namespace doris |