]> git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/cpp/src/gandiva/function_registry_string.cc
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / cpp / src / gandiva / function_registry_string.cc
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 "gandiva/function_registry_string.h"
19
20 #include "gandiva/function_registry_common.h"
21
22 namespace gandiva {
23
24 #define BINARY_RELATIONAL_SAFE_NULL_IF_NULL_FN(name, ALIASES) \
25 VAR_LEN_TYPES(BINARY_RELATIONAL_SAFE_NULL_IF_NULL, name, ALIASES)
26
27 #define BINARY_RELATIONAL_SAFE_NULL_IF_NULL_UTF8_FN(name, ALIASES) \
28 BINARY_RELATIONAL_SAFE_NULL_IF_NULL(name, ALIASES, utf8)
29
30 #define UNARY_OCTET_LEN_FN(name, ALIASES) \
31 UNARY_SAFE_NULL_IF_NULL(name, ALIASES, utf8, int32), \
32 UNARY_SAFE_NULL_IF_NULL(name, ALIASES, binary, int32)
33
34 #define UNARY_SAFE_NULL_NEVER_BOOL_FN(name, ALIASES) \
35 VAR_LEN_TYPES(UNARY_SAFE_NULL_NEVER_BOOL, name, ALIASES)
36
37 std::vector<NativeFunction> GetStringFunctionRegistry() {
38 static std::vector<NativeFunction> string_fn_registry_ = {
39 BINARY_RELATIONAL_SAFE_NULL_IF_NULL_FN(equal, {}),
40 BINARY_RELATIONAL_SAFE_NULL_IF_NULL_FN(not_equal, {}),
41 BINARY_RELATIONAL_SAFE_NULL_IF_NULL_FN(less_than, {}),
42 BINARY_RELATIONAL_SAFE_NULL_IF_NULL_FN(less_than_or_equal_to, {}),
43 BINARY_RELATIONAL_SAFE_NULL_IF_NULL_FN(greater_than, {}),
44 BINARY_RELATIONAL_SAFE_NULL_IF_NULL_FN(greater_than_or_equal_to, {}),
45
46 BINARY_RELATIONAL_SAFE_NULL_IF_NULL_UTF8_FN(starts_with, {}),
47 BINARY_RELATIONAL_SAFE_NULL_IF_NULL_UTF8_FN(ends_with, {}),
48 BINARY_RELATIONAL_SAFE_NULL_IF_NULL_UTF8_FN(is_substr, {}),
49
50 BINARY_UNSAFE_NULL_IF_NULL(locate, {"position"}, utf8, int32),
51 BINARY_UNSAFE_NULL_IF_NULL(strpos, {}, utf8, int32),
52
53 UNARY_OCTET_LEN_FN(octet_length, {}), UNARY_OCTET_LEN_FN(bit_length, {}),
54
55 UNARY_UNSAFE_NULL_IF_NULL(char_length, {}, utf8, int32),
56 UNARY_UNSAFE_NULL_IF_NULL(length, {}, utf8, int32),
57 UNARY_UNSAFE_NULL_IF_NULL(lengthUtf8, {}, binary, int32),
58 UNARY_UNSAFE_NULL_IF_NULL(reverse, {}, utf8, utf8),
59 UNARY_UNSAFE_NULL_IF_NULL(ltrim, {}, utf8, utf8),
60 UNARY_UNSAFE_NULL_IF_NULL(rtrim, {}, utf8, utf8),
61 UNARY_UNSAFE_NULL_IF_NULL(btrim, {}, utf8, utf8),
62 UNARY_UNSAFE_NULL_IF_NULL(space, {}, int32, utf8),
63 UNARY_UNSAFE_NULL_IF_NULL(space, {}, int64, utf8),
64
65 UNARY_SAFE_NULL_NEVER_BOOL_FN(isnull, {}),
66 UNARY_SAFE_NULL_NEVER_BOOL_FN(isnotnull, {}),
67
68 NativeFunction("ascii", {}, DataTypeVector{utf8()}, int32(), kResultNullIfNull,
69 "ascii_utf8"),
70
71 NativeFunction("base64", {}, DataTypeVector{binary()}, utf8(), kResultNullIfNull,
72 "gdv_fn_base64_encode_binary", NativeFunction::kNeedsContext),
73
74 NativeFunction("unbase64", {}, DataTypeVector{utf8()}, binary(), kResultNullIfNull,
75 "gdv_fn_base64_decode_utf8", NativeFunction::kNeedsContext),
76
77 NativeFunction("repeat", {}, DataTypeVector{utf8(), int32()}, utf8(),
78 kResultNullIfNull, "repeat_utf8_int32",
79 NativeFunction::kNeedsContext),
80
81 NativeFunction("upper", {}, DataTypeVector{utf8()}, utf8(), kResultNullIfNull,
82 "gdv_fn_upper_utf8", NativeFunction::kNeedsContext),
83
84 NativeFunction("lower", {}, DataTypeVector{utf8()}, utf8(), kResultNullIfNull,
85 "gdv_fn_lower_utf8", NativeFunction::kNeedsContext),
86
87 NativeFunction("initcap", {}, DataTypeVector{utf8()}, utf8(), kResultNullIfNull,
88 "gdv_fn_initcap_utf8",
89 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
90
91 NativeFunction("castBIT", {"castBOOLEAN"}, DataTypeVector{utf8()}, boolean(),
92 kResultNullIfNull, "castBIT_utf8", NativeFunction::kNeedsContext),
93
94 NativeFunction("castINT", {}, DataTypeVector{utf8()}, int32(), kResultNullIfNull,
95 "gdv_fn_castINT_utf8",
96 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
97
98 NativeFunction("castBIGINT", {}, DataTypeVector{utf8()}, int64(), kResultNullIfNull,
99 "gdv_fn_castBIGINT_utf8",
100 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
101
102 NativeFunction("castFLOAT4", {}, DataTypeVector{utf8()}, float32(),
103 kResultNullIfNull, "gdv_fn_castFLOAT4_utf8",
104 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
105
106 NativeFunction("castFLOAT8", {}, DataTypeVector{utf8()}, float64(),
107 kResultNullIfNull, "gdv_fn_castFLOAT8_utf8",
108 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
109
110 NativeFunction("castINT", {}, DataTypeVector{binary()}, int32(), kResultNullIfNull,
111 "gdv_fn_castINT_varbinary",
112 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
113
114 NativeFunction("castBIGINT", {}, DataTypeVector{binary()}, int64(),
115 kResultNullIfNull, "gdv_fn_castBIGINT_varbinary",
116 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
117
118 NativeFunction("castFLOAT4", {}, DataTypeVector{binary()}, float32(),
119 kResultNullIfNull, "gdv_fn_castFLOAT4_varbinary",
120 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
121
122 NativeFunction("castFLOAT8", {}, DataTypeVector{binary()}, float64(),
123 kResultNullIfNull, "gdv_fn_castFLOAT8_varbinary",
124 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
125
126 NativeFunction("castVARCHAR", {}, DataTypeVector{boolean(), int64()}, utf8(),
127 kResultNullIfNull, "castVARCHAR_bool_int64",
128 NativeFunction::kNeedsContext),
129
130 NativeFunction("castVARCHAR", {}, DataTypeVector{utf8(), int64()}, utf8(),
131 kResultNullIfNull, "castVARCHAR_utf8_int64",
132 NativeFunction::kNeedsContext),
133
134 NativeFunction("castVARCHAR", {}, DataTypeVector{binary(), int64()}, utf8(),
135 kResultNullIfNull, "castVARCHAR_binary_int64",
136 NativeFunction::kNeedsContext),
137
138 NativeFunction("castVARCHAR", {}, DataTypeVector{int32(), int64()}, utf8(),
139 kResultNullIfNull, "gdv_fn_castVARCHAR_int32_int64",
140 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
141
142 NativeFunction("castVARCHAR", {}, DataTypeVector{int64(), int64()}, utf8(),
143 kResultNullIfNull, "gdv_fn_castVARCHAR_int64_int64",
144 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
145
146 NativeFunction("castVARCHAR", {}, DataTypeVector{float32(), int64()}, utf8(),
147 kResultNullIfNull, "gdv_fn_castVARCHAR_float32_int64",
148 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
149
150 NativeFunction("castVARCHAR", {}, DataTypeVector{float64(), int64()}, utf8(),
151 kResultNullIfNull, "gdv_fn_castVARCHAR_float64_int64",
152 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
153
154 NativeFunction("castVARCHAR", {}, DataTypeVector{decimal128(), int64()}, utf8(),
155 kResultNullIfNull, "castVARCHAR_decimal128_int64",
156 NativeFunction::kNeedsContext),
157
158 NativeFunction("like", {}, DataTypeVector{utf8(), utf8()}, boolean(),
159 kResultNullIfNull, "gdv_fn_like_utf8_utf8",
160 NativeFunction::kNeedsFunctionHolder),
161
162 NativeFunction("like", {}, DataTypeVector{utf8(), utf8(), utf8()}, boolean(),
163 kResultNullIfNull, "gdv_fn_like_utf8_utf8_utf8",
164 NativeFunction::kNeedsFunctionHolder),
165
166 NativeFunction("ilike", {}, DataTypeVector{utf8(), utf8()}, boolean(),
167 kResultNullIfNull, "gdv_fn_ilike_utf8_utf8",
168 NativeFunction::kNeedsFunctionHolder),
169
170 NativeFunction("ltrim", {}, DataTypeVector{utf8(), utf8()}, utf8(),
171 kResultNullIfNull, "ltrim_utf8_utf8", NativeFunction::kNeedsContext),
172
173 NativeFunction("rtrim", {}, DataTypeVector{utf8(), utf8()}, utf8(),
174 kResultNullIfNull, "rtrim_utf8_utf8", NativeFunction::kNeedsContext),
175
176 NativeFunction("btrim", {}, DataTypeVector{utf8(), utf8()}, utf8(),
177 kResultNullIfNull, "btrim_utf8_utf8", NativeFunction::kNeedsContext),
178
179 NativeFunction("substr", {"substring"},
180 DataTypeVector{utf8(), int64() /*offset*/, int64() /*length*/},
181 utf8(), kResultNullIfNull, "substr_utf8_int64_int64",
182 NativeFunction::kNeedsContext),
183
184 NativeFunction("substr", {"substring"}, DataTypeVector{utf8(), int64() /*offset*/},
185 utf8(), kResultNullIfNull, "substr_utf8_int64",
186 NativeFunction::kNeedsContext),
187
188 NativeFunction("lpad", {}, DataTypeVector{utf8(), int32(), utf8()}, utf8(),
189 kResultNullIfNull, "lpad_utf8_int32_utf8",
190 NativeFunction::kNeedsContext),
191
192 NativeFunction("lpad", {}, DataTypeVector{utf8(), int32()}, utf8(),
193 kResultNullIfNull, "lpad_utf8_int32", NativeFunction::kNeedsContext),
194
195 NativeFunction("rpad", {}, DataTypeVector{utf8(), int32(), utf8()}, utf8(),
196 kResultNullIfNull, "rpad_utf8_int32_utf8",
197 NativeFunction::kNeedsContext),
198
199 NativeFunction("rpad", {}, DataTypeVector{utf8(), int32()}, utf8(),
200 kResultNullIfNull, "rpad_utf8_int32", NativeFunction::kNeedsContext),
201
202 NativeFunction("regexp_replace", {}, DataTypeVector{utf8(), utf8(), utf8()}, utf8(),
203 kResultNullIfNull, "gdv_fn_regexp_replace_utf8_utf8",
204 NativeFunction::kNeedsContext |
205 NativeFunction::kNeedsFunctionHolder |
206 NativeFunction::kCanReturnErrors),
207
208 NativeFunction("concatOperator", {}, DataTypeVector{utf8(), utf8()}, utf8(),
209 kResultNullIfNull, "concatOperator_utf8_utf8",
210 NativeFunction::kNeedsContext),
211 NativeFunction("concatOperator", {}, DataTypeVector{utf8(), utf8(), utf8()}, utf8(),
212 kResultNullIfNull, "concatOperator_utf8_utf8_utf8",
213 NativeFunction::kNeedsContext),
214 NativeFunction("concatOperator", {}, DataTypeVector{utf8(), utf8(), utf8(), utf8()},
215 utf8(), kResultNullIfNull, "concatOperator_utf8_utf8_utf8_utf8",
216 NativeFunction::kNeedsContext),
217 NativeFunction("concatOperator", {},
218 DataTypeVector{utf8(), utf8(), utf8(), utf8(), utf8()}, utf8(),
219 kResultNullIfNull, "concatOperator_utf8_utf8_utf8_utf8_utf8",
220 NativeFunction::kNeedsContext),
221 NativeFunction("concatOperator", {},
222 DataTypeVector{utf8(), utf8(), utf8(), utf8(), utf8(), utf8()},
223 utf8(), kResultNullIfNull,
224 "concatOperator_utf8_utf8_utf8_utf8_utf8_utf8",
225 NativeFunction::kNeedsContext),
226 NativeFunction(
227 "concatOperator", {},
228 DataTypeVector{utf8(), utf8(), utf8(), utf8(), utf8(), utf8(), utf8()}, utf8(),
229 kResultNullIfNull, "concatOperator_utf8_utf8_utf8_utf8_utf8_utf8_utf8",
230 NativeFunction::kNeedsContext),
231 NativeFunction(
232 "concatOperator", {},
233 DataTypeVector{utf8(), utf8(), utf8(), utf8(), utf8(), utf8(), utf8(), utf8()},
234 utf8(), kResultNullIfNull,
235 "concatOperator_utf8_utf8_utf8_utf8_utf8_utf8_utf8_utf8",
236 NativeFunction::kNeedsContext),
237 NativeFunction("concatOperator", {},
238 DataTypeVector{utf8(), utf8(), utf8(), utf8(), utf8(), utf8(),
239 utf8(), utf8(), utf8()},
240 utf8(), kResultNullIfNull,
241 "concatOperator_utf8_utf8_utf8_utf8_utf8_utf8_utf8_utf8_utf8",
242 NativeFunction::kNeedsContext),
243 NativeFunction("concatOperator", {},
244 DataTypeVector{utf8(), utf8(), utf8(), utf8(), utf8(), utf8(),
245 utf8(), utf8(), utf8(), utf8()},
246 utf8(), kResultNullIfNull,
247 "concatOperator_utf8_utf8_utf8_utf8_utf8_utf8_utf8_utf8_utf8_utf8",
248 NativeFunction::kNeedsContext),
249
250 // concat treats null inputs as empty strings whereas concatOperator returns null if
251 // one of the inputs is null
252 NativeFunction("concat", {}, DataTypeVector{utf8(), utf8()}, utf8(),
253 kResultNullNever, "concat_utf8_utf8", NativeFunction::kNeedsContext),
254 NativeFunction("concat", {}, DataTypeVector{utf8(), utf8(), utf8()}, utf8(),
255 kResultNullNever, "concat_utf8_utf8_utf8",
256 NativeFunction::kNeedsContext),
257 NativeFunction("concat", {}, DataTypeVector{utf8(), utf8(), utf8(), utf8()}, utf8(),
258 kResultNullNever, "concat_utf8_utf8_utf8_utf8",
259 NativeFunction::kNeedsContext),
260 NativeFunction("concat", {}, DataTypeVector{utf8(), utf8(), utf8(), utf8(), utf8()},
261 utf8(), kResultNullNever, "concat_utf8_utf8_utf8_utf8_utf8",
262 NativeFunction::kNeedsContext),
263 NativeFunction("concat", {},
264 DataTypeVector{utf8(), utf8(), utf8(), utf8(), utf8(), utf8()},
265 utf8(), kResultNullNever, "concat_utf8_utf8_utf8_utf8_utf8_utf8",
266 NativeFunction::kNeedsContext),
267 NativeFunction(
268 "concat", {},
269 DataTypeVector{utf8(), utf8(), utf8(), utf8(), utf8(), utf8(), utf8()}, utf8(),
270 kResultNullNever, "concat_utf8_utf8_utf8_utf8_utf8_utf8_utf8",
271 NativeFunction::kNeedsContext),
272 NativeFunction(
273 "concat", {},
274 DataTypeVector{utf8(), utf8(), utf8(), utf8(), utf8(), utf8(), utf8(), utf8()},
275 utf8(), kResultNullNever, "concat_utf8_utf8_utf8_utf8_utf8_utf8_utf8_utf8",
276 NativeFunction::kNeedsContext),
277 NativeFunction("concat", {},
278 DataTypeVector{utf8(), utf8(), utf8(), utf8(), utf8(), utf8(),
279 utf8(), utf8(), utf8()},
280 utf8(), kResultNullNever,
281 "concat_utf8_utf8_utf8_utf8_utf8_utf8_utf8_utf8_utf8",
282 NativeFunction::kNeedsContext),
283 NativeFunction("concat", {},
284 DataTypeVector{utf8(), utf8(), utf8(), utf8(), utf8(), utf8(),
285 utf8(), utf8(), utf8(), utf8()},
286 utf8(), kResultNullNever,
287 "concat_utf8_utf8_utf8_utf8_utf8_utf8_utf8_utf8_utf8_utf8",
288 NativeFunction::kNeedsContext),
289
290 NativeFunction("byte_substr", {"bytesubstring"},
291 DataTypeVector{binary(), int32(), int32()}, binary(),
292 kResultNullIfNull, "byte_substr_binary_int32_int32",
293 NativeFunction::kNeedsContext),
294
295 NativeFunction("convert_fromUTF8", {"convert_fromutf8"}, DataTypeVector{binary()},
296 utf8(), kResultNullIfNull, "convert_fromUTF8_binary",
297 NativeFunction::kNeedsContext),
298
299 NativeFunction("convert_replaceUTF8", {"convert_replaceutf8"},
300 DataTypeVector{binary(), utf8()}, utf8(), kResultNullIfNull,
301 "convert_replace_invalid_fromUTF8_binary",
302 NativeFunction::kNeedsContext),
303
304 NativeFunction("convert_toDOUBLE", {}, DataTypeVector{float64()}, binary(),
305 kResultNullIfNull, "convert_toDOUBLE",
306 NativeFunction::kNeedsContext),
307
308 NativeFunction("convert_toDOUBLE_be", {}, DataTypeVector{float64()}, binary(),
309 kResultNullIfNull, "convert_toDOUBLE_be",
310 NativeFunction::kNeedsContext),
311
312 NativeFunction("convert_toFLOAT", {}, DataTypeVector{float32()}, binary(),
313 kResultNullIfNull, "convert_toFLOAT", NativeFunction::kNeedsContext),
314
315 NativeFunction("convert_toFLOAT_be", {}, DataTypeVector{float32()}, binary(),
316 kResultNullIfNull, "convert_toFLOAT_be",
317 NativeFunction::kNeedsContext),
318
319 NativeFunction("convert_toINT", {}, DataTypeVector{int32()}, binary(),
320 kResultNullIfNull, "convert_toINT", NativeFunction::kNeedsContext),
321
322 NativeFunction("convert_toINT_be", {}, DataTypeVector{int32()}, binary(),
323 kResultNullIfNull, "convert_toINT_be",
324 NativeFunction::kNeedsContext),
325
326 NativeFunction("convert_toBIGINT", {}, DataTypeVector{int64()}, binary(),
327 kResultNullIfNull, "convert_toBIGINT",
328 NativeFunction::kNeedsContext),
329
330 NativeFunction("convert_toBIGINT_be", {}, DataTypeVector{int64()}, binary(),
331 kResultNullIfNull, "convert_toBIGINT_be",
332 NativeFunction::kNeedsContext),
333
334 NativeFunction("convert_toBOOLEAN_BYTE", {}, DataTypeVector{boolean()}, binary(),
335 kResultNullIfNull, "convert_toBOOLEAN",
336 NativeFunction::kNeedsContext),
337
338 NativeFunction("convert_toTIME_EPOCH", {}, DataTypeVector{time32()}, binary(),
339 kResultNullIfNull, "convert_toTIME_EPOCH",
340 NativeFunction::kNeedsContext),
341
342 NativeFunction("convert_toTIME_EPOCH_be", {}, DataTypeVector{time32()}, binary(),
343 kResultNullIfNull, "convert_toTIME_EPOCH_be",
344 NativeFunction::kNeedsContext),
345
346 NativeFunction("convert_toTIMESTAMP_EPOCH", {}, DataTypeVector{timestamp()},
347 binary(), kResultNullIfNull, "convert_toTIMESTAMP_EPOCH",
348 NativeFunction::kNeedsContext),
349
350 NativeFunction("convert_toTIMESTAMP_EPOCH_be", {}, DataTypeVector{timestamp()},
351 binary(), kResultNullIfNull, "convert_toTIMESTAMP_EPOCH_be",
352 NativeFunction::kNeedsContext),
353
354 NativeFunction("convert_toDATE_EPOCH", {}, DataTypeVector{date64()}, binary(),
355 kResultNullIfNull, "convert_toDATE_EPOCH",
356 NativeFunction::kNeedsContext),
357
358 NativeFunction("convert_toDATE_EPOCH_be", {}, DataTypeVector{date64()}, binary(),
359 kResultNullIfNull, "convert_toDATE_EPOCH_be",
360 NativeFunction::kNeedsContext),
361
362 NativeFunction("convert_toUTF8", {}, DataTypeVector{utf8()}, binary(),
363 kResultNullIfNull, "convert_toUTF8", NativeFunction::kNeedsContext),
364
365 NativeFunction("locate", {"position"}, DataTypeVector{utf8(), utf8(), int32()},
366 int32(), kResultNullIfNull, "locate_utf8_utf8_int32",
367 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
368
369 NativeFunction("replace", {}, DataTypeVector{utf8(), utf8(), utf8()}, utf8(),
370 kResultNullIfNull, "replace_utf8_utf8_utf8",
371 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
372
373 NativeFunction("binary_string", {}, DataTypeVector{utf8()}, binary(),
374 kResultNullIfNull, "binary_string", NativeFunction::kNeedsContext),
375
376 NativeFunction("left", {}, DataTypeVector{utf8(), int32()}, utf8(),
377 kResultNullIfNull, "left_utf8_int32", NativeFunction::kNeedsContext),
378
379 NativeFunction("right", {}, DataTypeVector{utf8(), int32()}, utf8(),
380 kResultNullIfNull, "right_utf8_int32",
381 NativeFunction::kNeedsContext),
382
383 NativeFunction("castVARBINARY", {}, DataTypeVector{binary(), int64()}, binary(),
384 kResultNullIfNull, "castVARBINARY_binary_int64",
385 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
386
387 NativeFunction("castVARBINARY", {}, DataTypeVector{utf8(), int64()}, binary(),
388 kResultNullIfNull, "castVARBINARY_utf8_int64",
389 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
390
391 NativeFunction("castVARBINARY", {}, DataTypeVector{int32(), int64()}, binary(),
392 kResultNullIfNull, "gdv_fn_castVARBINARY_int32_int64",
393 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
394
395 NativeFunction("castVARBINARY", {}, DataTypeVector{int64(), int64()}, binary(),
396 kResultNullIfNull, "gdv_fn_castVARBINARY_int64_int64",
397 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
398
399 NativeFunction("castVARBINARY", {}, DataTypeVector{float32(), int64()}, binary(),
400 kResultNullIfNull, "gdv_fn_castVARBINARY_float32_int64",
401 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
402
403 NativeFunction("castVARBINARY", {}, DataTypeVector{float64(), int64()}, binary(),
404 kResultNullIfNull, "gdv_fn_castVARBINARY_float64_int64",
405 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors),
406
407 NativeFunction("split_part", {}, DataTypeVector{utf8(), utf8(), int32()}, utf8(),
408 kResultNullIfNull, "split_part",
409 NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors)};
410
411 return string_fn_registry_;
412 }
413
414 #undef BINARY_RELATIONAL_SAFE_NULL_IF_NULL_FN
415
416 #undef BINARY_RELATIONAL_SAFE_NULL_IF_NULL_UTF8_FN
417
418 #undef UNARY_OCTET_LEN_FN
419
420 #undef UNARY_SAFE_NULL_NEVER_BOOL_FN
421
422 } // namespace gandiva