OmniSciDB  a5dc49c757
 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)
 
#define EXTARGGEOTYPECASE(GEOTYPE, KTYPE)
 

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 EXTARGGEOTYPECASE (   GEOTYPE,
  KTYPE 
)
Value:
case ExtArgumentType::Geo##GEOTYPE: \
type = KTYPE; \
subtype = kGEOMETRY; \
break; \
case ExtArgumentType::ColumnGeo##GEOTYPE: \
subtype = KTYPE; \
break; \
case ExtArgumentType::ColumnListGeo##GEOTYPE: \
subtype = KTYPE; \
break;

Referenced by ext_arg_type_to_type_info().

#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; \
n = true; \
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;
constexpr double n
Definition: Utm.h:38

Referenced by ext_arg_type_to_type_info().

Typedef Documentation

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

Definition at line 1027 of file ExtensionFunctionsWhitelist.cpp.

Function Documentation

SQLTypeInfo ext_arg_type_to_type_info ( const ExtArgumentType  ext_arg_type)

Definition at line 346 of file ExtensionFunctionsWhitelist.cpp.

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

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().

346  {
347  SQLTypes type = kNULLT;
348  int d = 0;
349  int s = 0;
350  bool n = false;
352  int p = 0;
353  SQLTypes subtype = kNULLT;
354 
355 #define EXTARGTYPECASE(EXTARGTYPE, ELEMTYPE, ENCODING, ARRAYENCODING) \
356  case ExtArgumentType::EXTARGTYPE: \
357  type = ELEMTYPE; \
358  c = kENCODING_##ENCODING; \
359  break; \
360  case ExtArgumentType::Array##EXTARGTYPE: \
361  type = kARRAY; \
362  c = kENCODING_##ENCODING; \
363  subtype = ELEMTYPE; \
364  n = true; \
365  break; \
366  case ExtArgumentType::Column##EXTARGTYPE: \
367  type = kCOLUMN; \
368  c = kENCODING_##ENCODING; \
369  subtype = ELEMTYPE; \
370  break; \
371  case ExtArgumentType::ColumnList##EXTARGTYPE: \
372  type = kCOLUMN_LIST; \
373  c = kENCODING_##ENCODING; \
374  subtype = ELEMTYPE; \
375  break; \
376  case ExtArgumentType::ColumnArray##EXTARGTYPE: \
377  type = kCOLUMN; \
378  subtype = ELEMTYPE; \
379  c = kENCODING_##ARRAYENCODING; \
380  break; \
381  case ExtArgumentType::ColumnListArray##EXTARGTYPE: \
382  type = kCOLUMN_LIST; \
383  subtype = ELEMTYPE; \
384  c = kENCODING_##ARRAYENCODING; \
385  break;
386 
387 #define EXTARGGEOTYPECASE(GEOTYPE, KTYPE) \
388  case ExtArgumentType::Geo##GEOTYPE: \
389  type = KTYPE; \
390  subtype = kGEOMETRY; \
391  break; \
392  case ExtArgumentType::ColumnGeo##GEOTYPE: \
393  type = kCOLUMN; \
394  subtype = KTYPE; \
395  break; \
396  case ExtArgumentType::ColumnListGeo##GEOTYPE: \
397  type = kCOLUMN_LIST; \
398  subtype = KTYPE; \
399  break;
400 
401  switch (ext_arg_type) {
402  EXTARGTYPECASE(Bool, kBOOLEAN, NONE, ARRAY);
403  EXTARGTYPECASE(Int8, kTINYINT, NONE, ARRAY);
405  EXTARGTYPECASE(Int32, kINT, NONE, ARRAY);
406  EXTARGTYPECASE(Int64, kBIGINT, NONE, ARRAY);
407  EXTARGTYPECASE(Float, kFLOAT, NONE, ARRAY);
408  EXTARGTYPECASE(Double, kDOUBLE, NONE, ARRAY);
410  EXTARGTYPECASE(TextEncodingDict, kTEXT, DICT, ARRAY_DICT);
411  // TODO: EXTARGTYPECASE(Timestamp, kTIMESTAMP, NONE, ARRAY);
413  type = kTIMESTAMP;
414  c = kENCODING_NONE;
415  d = 9;
416  break;
418  type = kCOLUMN;
419  subtype = kTIMESTAMP;
420  c = kENCODING_NONE;
421  d = 9;
422  break;
424  type = kINTERVAL_DAY_TIME;
425  break;
427  type = kINTERVAL_YEAR_MONTH;
428  break;
429  EXTARGGEOTYPECASE(Point, kPOINT);
430  EXTARGGEOTYPECASE(LineString, kLINESTRING);
431  EXTARGGEOTYPECASE(Polygon, kPOLYGON);
432  EXTARGGEOTYPECASE(MultiPoint, kMULTIPOINT);
433  EXTARGGEOTYPECASE(MultiLineString, kMULTILINESTRING);
434  EXTARGGEOTYPECASE(MultiPolygon, kMULTIPOLYGON);
435  default:
436  LOG(FATAL) << "ExtArgumentType `" << serialize_type(ext_arg_type)
437  << "` cannot be converted to SQLTypes.";
438  UNREACHABLE();
439  }
440  return SQLTypeInfo(type, d, s, n, c, p, subtype);
441 }
SQLTypes
Definition: sqltypes.h:65
#define LOG(tag)
Definition: Logger.h:285
#define UNREACHABLE()
Definition: Logger.h:338
EncodingType
Definition: sqltypes.h:240
#define EXTARGTYPECASE(EXTARGTYPE, ELEMTYPE, ENCODING, ARRAYENCODING)
Definition: sqltypes.h:79
#define EXTARGGEOTYPECASE(GEOTYPE, KTYPE)
std::string serialize_type(const ExtArgumentType type, bool byval=true, bool declare=false)
Definition: sqltypes.h:72
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 1115 of file ExtensionFunctionsWhitelist.cpp.

References ExtensionFunctionsWhitelist::toString().

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

+ Here is the call graph for this function: