OmniSciDB  c0231cc57d
 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
}
 

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 

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,
109 };

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:52
#define LOG(tag)
Definition: Logger.h:216
#define UNREACHABLE()
Definition: Logger.h:266
EncodingType
Definition: sqltypes.h:253
#define EXTARGTYPECASE(EXTARGTYPE, ELEMTYPE, ENCODING, ARRAYENCODING)
Definition: sqltypes.h:66
std::string serialize_type(const ExtArgumentType type, bool byval=true, bool declare=false)
Definition: sqltypes.h:59
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: