OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TableFunctionHelper.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
20 
22  switch (ext_arg_type) {
71  default:
72  return ext_arg_type;
73  }
74 }
75 
77  const ExtArgumentType ext_arg_type) {
78  switch (ext_arg_type) {
115  default:
116  return ext_arg_type;
117  }
118 }
119 
120 inline bool is_ext_arg_type_array(const ExtArgumentType ext_arg_type) {
121  switch (ext_arg_type) {
131  return true;
132 
133  default:
134  return false;
135  }
136 }
137 
138 inline bool is_ext_arg_type_column(const ExtArgumentType ext_arg_type) {
139  switch (ext_arg_type) {
165  return true;
166 
167  default:
168  return false;
169  }
170 }
171 
172 inline bool is_ext_arg_type_column_list(const ExtArgumentType ext_arg_type) {
173  switch (ext_arg_type) {
198  return true;
199 
200  default:
201  return false;
202  }
203 }
204 
205 inline bool is_ext_arg_type_geo(const ExtArgumentType ext_arg_type) {
206  switch (ext_arg_type) {
213  return true;
214 
215  default:
216  return false;
217  }
218 }
219 
220 inline bool is_ext_arg_type_pointer(const ExtArgumentType ext_arg_type) {
221  switch (ext_arg_type) {
229  return true;
230 
231  default:
232  return false;
233  }
234 }
235 
236 // TODO(pearu): rename is_ext_arg_type_scalar to is_ext_arg_type_literal
237 inline bool is_ext_arg_type_scalar(const ExtArgumentType ext_arg_type) {
238  switch (ext_arg_type) {
260  return true;
261 
262  default:
263  return false;
264  }
265 }
266 
267 inline bool is_ext_arg_type_scalar_integer(const ExtArgumentType ext_arg_type) {
268  switch (ext_arg_type) {
276  return true;
277  default:
278  return false;
279  }
280 }
281 
282 inline int32_t max_digits_for_ext_integer_arg(const ExtArgumentType ext_arg_type) {
283  switch (ext_arg_type) {
285  return 2;
287  return 4;
289  return 9;
291  return 18;
292  default:
293  UNREACHABLE();
294  return 0;
295  }
296 }
297 
298 inline bool is_ext_arg_type_nonscalar(const ExtArgumentType ext_arg_type) {
299  return !is_ext_arg_type_scalar(ext_arg_type);
300 }
bool is_ext_arg_type_scalar(const ExtArgumentType ext_arg_type)
bool is_ext_arg_type_column(const ExtArgumentType ext_arg_type)
#define UNREACHABLE()
Definition: Logger.h:338
bool is_ext_arg_type_scalar_integer(const ExtArgumentType ext_arg_type)
ExtArgumentType ext_arg_type_ensure_column(const ExtArgumentType ext_arg_type)
bool is_ext_arg_type_column_list(const ExtArgumentType ext_arg_type)
bool is_ext_arg_type_nonscalar(const ExtArgumentType ext_arg_type)
Supported runtime functions management and retrieval.
bool is_ext_arg_type_geo(const ExtArgumentType ext_arg_type)
bool is_ext_arg_type_array(const ExtArgumentType ext_arg_type)
int32_t max_digits_for_ext_integer_arg(const ExtArgumentType ext_arg_type)
ExtArgumentType ext_arg_type_ensure_column_list(const ExtArgumentType ext_arg_type)
bool is_ext_arg_type_pointer(const ExtArgumentType ext_arg_type)