OmniSciDB  ca0c39ec8f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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}
 

Macros

#define EXTARGTYPECASE(EXTARGTYPE, ELEMTYPE, ENCODING, ARRAYENCODING)
 

Typedefs

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

Functions

std::string anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::serialize_type (const ExtArgumentType type, bool byval=true, bool declare=false)
 
std::string anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::drop_suffix (const std::string &str)
 
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 toString (const ExtArgumentType &sig_type)
 

Macro Definition Documentation

#define EXTARGTYPECASE (   EXTARGTYPE,
  ELEMTYPE,
  ENCODING,
  ARRAYENCODING 
)
Value:
case ExtArgumentType::EXTARGTYPE: \
type = ELEMTYPE; \
c = kENCODING_##ENCODING; \
break; \
case ExtArgumentType::Array##EXTARGTYPE: \
c = kENCODING_##ENCODING; \
subtype = ELEMTYPE; \
break; \
case ExtArgumentType::Column##EXTARGTYPE: \
c = kENCODING_##ENCODING; \
subtype = ELEMTYPE; \
break; \
case ExtArgumentType::ColumnList##EXTARGTYPE: \
c = kENCODING_##ENCODING; \
subtype = ELEMTYPE; \
break; \
case ExtArgumentType::ColumnArray##EXTARGTYPE: \
subtype = ELEMTYPE; \
c = kENCODING_##ARRAYENCODING; \
break; \
case ExtArgumentType::ColumnListArray##EXTARGTYPE: \
subtype = ELEMTYPE; \
c = kENCODING_##ARRAYENCODING; \
break;

Referenced by ext_arg_type_to_type_info().

Typedef Documentation

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

Definition at line 859 of file ExtensionFunctionsWhitelist.cpp.

Function Documentation

SQLTypeInfo ext_arg_type_to_type_info ( const ExtArgumentType  ext_arg_type)

Definition at line 309 of file ExtensionFunctionsWhitelist.cpp.

References Bool, ColumnTimestamp, Double, EXTARGTYPECASE, logger::FATAL, Float, Int16, Int32, Int64, Int8, kBIGINT, kBOOLEAN, kCOLUMN, kDOUBLE, kENCODING_NONE, kFLOAT, kINT, kNULLT, kSMALLINT, kTEXT, kTIMESTAMP, kTINYINT, LOG, anonymous_namespace{Utm.h}::n, NONE, anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::serialize_type(), Timestamp, run_benchmark_import::type, and UNREACHABLE.

Referenced by bind_function(), RelAlgExecutor::createTableFunctionWorkUnit(), table_functions::anonymous_namespace{TableFunctionsFactory.cpp}::ext_arg_pointer_type_to_type_info(), table_functions::anonymous_namespace{TableFunctionsFactory.cpp}::ext_arg_type_to_type_info_output(), ExtensionFunctionsWhitelist::get_ext_funcs(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_numeric_argument(), and RelAlgTranslator::translateFunction().

309  {
310  SQLTypes type = kNULLT;
311  int d = 0;
312  int s = 0;
313  bool n = false;
315  int p = 0;
316  SQLTypes subtype = kNULLT;
317 
318 #define EXTARGTYPECASE(EXTARGTYPE, ELEMTYPE, ENCODING, ARRAYENCODING) \
319  case ExtArgumentType::EXTARGTYPE: \
320  type = ELEMTYPE; \
321  c = kENCODING_##ENCODING; \
322  break; \
323  case ExtArgumentType::Array##EXTARGTYPE: \
324  type = kARRAY; \
325  c = kENCODING_##ENCODING; \
326  subtype = ELEMTYPE; \
327  break; \
328  case ExtArgumentType::Column##EXTARGTYPE: \
329  type = kCOLUMN; \
330  c = kENCODING_##ENCODING; \
331  subtype = ELEMTYPE; \
332  break; \
333  case ExtArgumentType::ColumnList##EXTARGTYPE: \
334  type = kCOLUMN_LIST; \
335  c = kENCODING_##ENCODING; \
336  subtype = ELEMTYPE; \
337  break; \
338  case ExtArgumentType::ColumnArray##EXTARGTYPE: \
339  type = kCOLUMN; \
340  subtype = ELEMTYPE; \
341  c = kENCODING_##ARRAYENCODING; \
342  break; \
343  case ExtArgumentType::ColumnListArray##EXTARGTYPE: \
344  type = kCOLUMN_LIST; \
345  subtype = ELEMTYPE; \
346  c = kENCODING_##ARRAYENCODING; \
347  break;
348 
349  switch (ext_arg_type) {
350  EXTARGTYPECASE(Bool, kBOOLEAN, NONE, ARRAY);
351  EXTARGTYPECASE(Int8, kTINYINT, NONE, ARRAY);
353  EXTARGTYPECASE(Int32, kINT, NONE, ARRAY);
354  EXTARGTYPECASE(Int64, kBIGINT, NONE, ARRAY);
355  EXTARGTYPECASE(Float, kFLOAT, NONE, ARRAY);
356  EXTARGTYPECASE(Double, kDOUBLE, NONE, ARRAY);
358  EXTARGTYPECASE(TextEncodingDict, kTEXT, DICT, ARRAY_DICT);
359  // TODO: EXTARGTYPECASE(Timestamp, kTIMESTAMP, NONE, ARRAY);
361  type = kTIMESTAMP;
362  c = kENCODING_NONE;
363  d = 9;
364  break;
366  type = kCOLUMN;
367  subtype = kTIMESTAMP;
368  c = kENCODING_NONE;
369  d = 9;
370  break;
371  default:
372  LOG(FATAL) << "ExtArgumentType `" << serialize_type(ext_arg_type)
373  << "` cannot be converted to SQLTypes.";
374  UNREACHABLE();
375  }
376  return SQLTypeInfo(type, d, s, n, c, p, subtype);
377 }
SQLTypes
Definition: sqltypes.h:53
#define LOG(tag)
Definition: Logger.h:216
#define UNREACHABLE()
Definition: Logger.h:266
EncodingType
Definition: sqltypes.h:228
#define EXTARGTYPECASE(EXTARGTYPE, ELEMTYPE, ENCODING, ARRAYENCODING)
Definition: sqltypes.h:67
std::string serialize_type(const ExtArgumentType type, bool byval=true, bool declare=false)
Definition: sqltypes.h:60
constexpr double n
Definition: Utm.h:38

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string toString ( const ExtArgumentType sig_type)

Definition at line 929 of file ExtensionFunctionsWhitelist.cpp.

References ExtensionFunctionsWhitelist::toString().

929  {
930  return ExtensionFunctionsWhitelist::toString(sig_type);
931 }
static std::string toString(const std::vector< ExtensionFunction > &ext_funcs, std::string tab="")

+ Here is the call graph for this function: