OmniSciDB  2b310ab3b2
 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 478 of file ExtensionFunctionsWhitelist.cpp.

Function Documentation

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(), 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: