OmniSciDB  8a228a1076
ExtensionFunctionsWhitelist.h File Reference
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "../Shared/sqltypes.h"
+ Include dependency graph for ExtensionFunctionsWhitelist.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ExtensionFunction
 
class  ExtensionFunctionsWhitelist
 

Enumerations

enum  ExtArgumentType {
  ExtArgumentType::Int8, ExtArgumentType::Int16, ExtArgumentType::Int32, ExtArgumentType::Int64,
  ExtArgumentType::Float, ExtArgumentType::Double, ExtArgumentType::Void, ExtArgumentType::PInt8,
  ExtArgumentType::PInt16, ExtArgumentType::PInt32, ExtArgumentType::PInt64, ExtArgumentType::PFloat,
  ExtArgumentType::PDouble, ExtArgumentType::PBool, ExtArgumentType::Bool, ExtArgumentType::ArrayInt8,
  ExtArgumentType::ArrayInt16, ExtArgumentType::ArrayInt32, ExtArgumentType::ArrayInt64, ExtArgumentType::ArrayFloat,
  ExtArgumentType::ArrayDouble, ExtArgumentType::ArrayBool, ExtArgumentType::GeoPoint, ExtArgumentType::GeoLineString,
  ExtArgumentType::Cursor, ExtArgumentType::GeoPolygon, ExtArgumentType::GeoMultiPolygon, ExtArgumentType::ColumnInt8,
  ExtArgumentType::ColumnInt16, ExtArgumentType::ColumnInt32, ExtArgumentType::ColumnInt64, ExtArgumentType::ColumnFloat,
  ExtArgumentType::ColumnDouble, ExtArgumentType::ColumnBool
}
 

Functions

SQLTypeInfo ext_arg_type_to_type_info (const ExtArgumentType ext_arg_type)
 

Enumeration Type Documentation

◆ ExtArgumentType

enum ExtArgumentType
strong
Enumerator
Int8 
Int16 
Int32 
Int64 
Float 
Double 
Void 
PInt8 
PInt16 
PInt32 
PInt64 
PFloat 
PDouble 
PBool 
Bool 
ArrayInt8 
ArrayInt16 
ArrayInt32 
ArrayInt64 
ArrayFloat 
ArrayDouble 
ArrayBool 
GeoPoint 
GeoLineString 
Cursor 
GeoPolygon 
GeoMultiPolygon 
ColumnInt8 
ColumnInt16 
ColumnInt32 
ColumnInt64 
ColumnFloat 
ColumnDouble 
ColumnBool 

Definition at line 35 of file ExtensionFunctionsWhitelist.h.

Function Documentation

◆ ext_arg_type_to_type_info()

SQLTypeInfo ext_arg_type_to_type_info ( const ExtArgumentType  ext_arg_type)

Definition at line 197 of file ExtensionFunctionsWhitelist.cpp.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, Bool, ColumnBool, ColumnDouble, ColumnFloat, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, Double, Float, Int16, Int32, Int64, Int8, kARRAY, kBIGINT, kBOOLEAN, kCOLUMN, kDOUBLE, kFLOAT, kINT, kNULLT, kSMALLINT, kTINYINT, LOG, anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::serialize_type(), and logger::WARNING.

Referenced by bind_function(), CodeGenerator::codegenFunctionOperCastArgs(), ExtensionFunctionsWhitelist::get_ext_funcs(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), and RelAlgTranslator::translateFunction().

197  {
198  /* This function is mostly used for scalar types.
199  For non-scalar types, NULL is returned as a placeholder.
200  */
201 
202  auto generate_array_type = [](const auto subtype) {
203  auto ti = SQLTypeInfo(kARRAY, false);
204  ti.set_subtype(subtype);
205  return ti;
206  };
207 
208  auto generate_column_type = [](const auto subtype) {
209  auto ti = SQLTypeInfo(kCOLUMN, false);
210  ti.set_subtype(subtype);
211  return ti;
212  };
213 
214  switch (ext_arg_type) {
216  return SQLTypeInfo(kBOOLEAN, false);
218  return SQLTypeInfo(kTINYINT, false);
220  return SQLTypeInfo(kSMALLINT, false);
222  return SQLTypeInfo(kINT, false);
224  return SQLTypeInfo(kBIGINT, false);
226  return SQLTypeInfo(kFLOAT, false);
228  return SQLTypeInfo(kDOUBLE, false);
230  return generate_array_type(kTINYINT);
232  return generate_array_type(kSMALLINT);
234  return generate_array_type(kINT);
236  return generate_array_type(kBIGINT);
238  return generate_array_type(kFLOAT);
240  return generate_array_type(kDOUBLE);
242  return generate_array_type(kBOOLEAN);
244  return generate_column_type(kTINYINT);
246  return generate_column_type(kSMALLINT);
248  return generate_column_type(kINT);
250  return generate_column_type(kBIGINT);
252  return generate_column_type(kFLOAT);
254  return generate_column_type(kDOUBLE);
256  return generate_column_type(kBOOLEAN);
257  default:
258  LOG(WARNING) << "ExtArgumentType `" << serialize_type(ext_arg_type)
259  << "` cannot be converted to SQLTypeInfo. Returning nulltype.";
260  }
261  return SQLTypeInfo(kNULLT, false);
262 }
#define LOG(tag)
Definition: Logger.h:188
Definition: sqltypes.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function: