OmniSciDB  0bd2ec9cf4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExtensionFunctionsWhitelist.cpp File Reference
#include "QueryEngine/ExtensionFunctionsWhitelist.h"
#include <boost/algorithm/string/join.hpp>
#include <iostream>
#include "QueryEngine/ExtensionFunctionsBinding.h"
#include "QueryEngine/JsonAccessors.h"
#include "QueryEngine/TableFunctions/TableFunctionsFactory.h"
#include "Shared/StringTransform.h"
+ Include dependency graph for ExtensionFunctionsWhitelist.cpp:

Go to the source code of this file.

Namespaces

 anonymous_namespace{ExtensionFunctionsWhitelist.cpp}
 

Typedefs

using SignatureMap = std::unordered_map< std::string, std::vector< ExtensionFunction >>
 

Functions

std::string anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::serialize_type (const ExtArgumentType type)
 
SQLTypeInfo ext_arg_type_to_type_info (const ExtArgumentType ext_arg_type)
 
ExtArgumentType anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::deserialize_type (const std::string &type_name)
 
std::string anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::drop_suffix (const std::string &str)
 

Typedef Documentation

using SignatureMap = std::unordered_map<std::string, std::vector<ExtensionFunction>>

Definition at line 408 of file ExtensionFunctionsWhitelist.cpp.

Function Documentation

SQLTypeInfo ext_arg_type_to_type_info ( const ExtArgumentType  ext_arg_type)

Definition at line 179 of file ExtensionFunctionsWhitelist.cpp.

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

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

179  {
180  /* This function is mostly used for scalar types.
181  For non-scalar types, NULL is returned as a placeholder.
182  */
183 
184  auto generate_array_type = [](const auto subtype) {
185  auto ti = SQLTypeInfo(kARRAY, false);
186  ti.set_subtype(subtype);
187  return ti;
188  };
189 
190  switch (ext_arg_type) {
192  return SQLTypeInfo(kBOOLEAN, false);
194  return SQLTypeInfo(kTINYINT, false);
196  return SQLTypeInfo(kSMALLINT, false);
198  return SQLTypeInfo(kINT, false);
200  return SQLTypeInfo(kBIGINT, false);
202  return SQLTypeInfo(kFLOAT, false);
204  return SQLTypeInfo(kDOUBLE, false);
206  return generate_array_type(kTINYINT);
208  return generate_array_type(kSMALLINT);
210  return generate_array_type(kINT);
212  return generate_array_type(kBIGINT);
214  return generate_array_type(kFLOAT);
216  return generate_array_type(kDOUBLE);
217  default:
218  LOG(WARNING) << "ExtArgumentType `" << serialize_type(ext_arg_type)
219  << "` cannot be converted to SQLTypeInfo. Returning nulltype.";
220  }
221  return SQLTypeInfo(kNULLT, false);
222 }
#define LOG(tag)
Definition: Logger.h:188
SQLTypeInfoCore< ArrayContextTypeSizer, ExecutorTypePackaging, DateTimeFacilities > SQLTypeInfo
Definition: sqltypes.h:852
Definition: sqltypes.h:48

+ Here is the call graph for this function:

+ Here is the caller graph for this function: