OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExtensionFunctionsWhitelist.h File Reference

Supported runtime functions management and retrieval. More...

#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "Shared/sqltypes.h"
#include "Shared/toString.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, ExtArgumentType::TextEncodingNone, ExtArgumentType::TextEncodingDict,
  ExtArgumentType::ColumnListInt8, ExtArgumentType::ColumnListInt16, ExtArgumentType::ColumnListInt32, ExtArgumentType::ColumnListInt64,
  ExtArgumentType::ColumnListFloat, ExtArgumentType::ColumnListDouble, ExtArgumentType::ColumnListBool, ExtArgumentType::ColumnTextEncodingDict,
  ExtArgumentType::ColumnListTextEncodingDict, ExtArgumentType::ColumnTimestamp, ExtArgumentType::Timestamp, ExtArgumentType::ColumnArrayInt8,
  ExtArgumentType::ColumnArrayInt16, ExtArgumentType::ColumnArrayInt32, ExtArgumentType::ColumnArrayInt64, ExtArgumentType::ColumnArrayFloat,
  ExtArgumentType::ColumnArrayDouble, ExtArgumentType::ColumnArrayBool, ExtArgumentType::ColumnListArrayInt8, ExtArgumentType::ColumnListArrayInt16,
  ExtArgumentType::ColumnListArrayInt32, ExtArgumentType::ColumnListArrayInt64, ExtArgumentType::ColumnListArrayFloat, ExtArgumentType::ColumnListArrayDouble,
  ExtArgumentType::ColumnListArrayBool, ExtArgumentType::GeoMultiLineString, ExtArgumentType::ArrayTextEncodingNone, ExtArgumentType::ColumnTextEncodingNone,
  ExtArgumentType::ColumnListTextEncodingNone, ExtArgumentType::ColumnArrayTextEncodingNone, ExtArgumentType::ColumnListArrayTextEncodingNone, ExtArgumentType::ArrayTextEncodingDict,
  ExtArgumentType::ColumnArrayTextEncodingDict, ExtArgumentType::ColumnListArrayTextEncodingDict, ExtArgumentType::GeoMultiPoint, ExtArgumentType::DayTimeInterval,
  ExtArgumentType::YearMonthTimeInterval
}
 

Functions

SQLTypeInfo ext_arg_type_to_type_info (const ExtArgumentType ext_arg_type)
 
std::string toString (const ExtArgumentType &sig_type)
 

Detailed Description

Supported runtime functions management and retrieval.

Definition in file ExtensionFunctionsWhitelist.h.

Enumeration Type Documentation

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 
TextEncodingNone 
TextEncodingDict 
ColumnListInt8 
ColumnListInt16 
ColumnListInt32 
ColumnListInt64 
ColumnListFloat 
ColumnListDouble 
ColumnListBool 
ColumnTextEncodingDict 
ColumnListTextEncodingDict 
ColumnTimestamp 
Timestamp 
ColumnArrayInt8 
ColumnArrayInt16 
ColumnArrayInt32 
ColumnArrayInt64 
ColumnArrayFloat 
ColumnArrayDouble 
ColumnArrayBool 
ColumnListArrayInt8 
ColumnListArrayInt16 
ColumnListArrayInt32 
ColumnListArrayInt64 
ColumnListArrayFloat 
ColumnListArrayDouble 
ColumnListArrayBool 
GeoMultiLineString 
ArrayTextEncodingNone 
ColumnTextEncodingNone 
ColumnListTextEncodingNone 
ColumnArrayTextEncodingNone 
ColumnListArrayTextEncodingNone 
ArrayTextEncodingDict 
ColumnArrayTextEncodingDict 
ColumnListArrayTextEncodingDict 
GeoMultiPoint 
DayTimeInterval 
YearMonthTimeInterval 

Definition at line 37 of file ExtensionFunctionsWhitelist.h.

37  {
38  Int8,
39  Int16,
40  Int32,
41  Int64,
42  Float,
43  Double,
44  Void,
45  PInt8,
46  PInt16,
47  PInt32,
48  PInt64,
49  PFloat,
50  PDouble,
51  PBool,
52  Bool,
53  ArrayInt8,
54  ArrayInt16,
55  ArrayInt32,
56  ArrayInt64,
57  ArrayFloat,
59  ArrayBool,
60  GeoPoint,
62  Cursor,
63  GeoPolygon,
65  ColumnInt8,
71  ColumnBool,
84  Timestamp,
111 };

Function Documentation

SQLTypeInfo ext_arg_type_to_type_info ( const ExtArgumentType  ext_arg_type)

Definition at line 313 of file ExtensionFunctionsWhitelist.cpp.

References Bool, ColumnTimestamp, DayTimeInterval, Double, EXTARGTYPECASE, logger::FATAL, Float, Int16, Int32, Int64, Int8, kBIGINT, kBOOLEAN, kCOLUMN, kDOUBLE, kENCODING_NONE, kFLOAT, kINT, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kNULLT, 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().

313  {
314  SQLTypes type = kNULLT;
315  int d = 0;
316  int s = 0;
317  bool n = false;
319  int p = 0;
320  SQLTypes subtype = kNULLT;
321 
322 #define EXTARGTYPECASE(EXTARGTYPE, ELEMTYPE, ENCODING, ARRAYENCODING) \
323  case ExtArgumentType::EXTARGTYPE: \
324  type = ELEMTYPE; \
325  c = kENCODING_##ENCODING; \
326  break; \
327  case ExtArgumentType::Array##EXTARGTYPE: \
328  type = kARRAY; \
329  c = kENCODING_##ENCODING; \
330  subtype = ELEMTYPE; \
331  break; \
332  case ExtArgumentType::Column##EXTARGTYPE: \
333  type = kCOLUMN; \
334  c = kENCODING_##ENCODING; \
335  subtype = ELEMTYPE; \
336  break; \
337  case ExtArgumentType::ColumnList##EXTARGTYPE: \
338  type = kCOLUMN_LIST; \
339  c = kENCODING_##ENCODING; \
340  subtype = ELEMTYPE; \
341  break; \
342  case ExtArgumentType::ColumnArray##EXTARGTYPE: \
343  type = kCOLUMN; \
344  subtype = ELEMTYPE; \
345  c = kENCODING_##ARRAYENCODING; \
346  break; \
347  case ExtArgumentType::ColumnListArray##EXTARGTYPE: \
348  type = kCOLUMN_LIST; \
349  subtype = ELEMTYPE; \
350  c = kENCODING_##ARRAYENCODING; \
351  break;
352 
353  switch (ext_arg_type) {
354  EXTARGTYPECASE(Bool, kBOOLEAN, NONE, ARRAY);
355  EXTARGTYPECASE(Int8, kTINYINT, NONE, ARRAY);
357  EXTARGTYPECASE(Int32, kINT, NONE, ARRAY);
358  EXTARGTYPECASE(Int64, kBIGINT, NONE, ARRAY);
359  EXTARGTYPECASE(Float, kFLOAT, NONE, ARRAY);
360  EXTARGTYPECASE(Double, kDOUBLE, NONE, ARRAY);
362  EXTARGTYPECASE(TextEncodingDict, kTEXT, DICT, ARRAY_DICT);
363  // TODO: EXTARGTYPECASE(Timestamp, kTIMESTAMP, NONE, ARRAY);
365  type = kTIMESTAMP;
366  c = kENCODING_NONE;
367  d = 9;
368  break;
370  type = kCOLUMN;
371  subtype = kTIMESTAMP;
372  c = kENCODING_NONE;
373  d = 9;
374  break;
376  type = kINTERVAL_DAY_TIME;
377  break;
379  type = kINTERVAL_YEAR_MONTH;
380  break;
381  default:
382  LOG(FATAL) << "ExtArgumentType `" << serialize_type(ext_arg_type)
383  << "` cannot be converted to SQLTypes.";
384  UNREACHABLE();
385  }
386  return SQLTypeInfo(type, d, s, n, c, p, subtype);
387 }
SQLTypes
Definition: sqltypes.h:53
#define LOG(tag)
Definition: Logger.h:283
#define UNREACHABLE()
Definition: Logger.h:333
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 982 of file ExtensionFunctionsWhitelist.cpp.

References ExtensionFunctionsWhitelist::toString().

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

+ Here is the call graph for this function: