OmniSciDB  a5dc49c757
 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, ExtArgumentType::ColumnGeoPoint, ExtArgumentType::ColumnGeoLineString, ExtArgumentType::ColumnGeoPolygon,
  ExtArgumentType::ColumnGeoMultiPoint, ExtArgumentType::ColumnGeoMultiLineString, ExtArgumentType::ColumnGeoMultiPolygon, ExtArgumentType::ColumnListGeoPoint,
  ExtArgumentType::ColumnListGeoLineString, ExtArgumentType::ColumnListGeoPolygon, ExtArgumentType::ColumnListGeoMultiPoint, ExtArgumentType::ColumnListGeoMultiLineString,
  ExtArgumentType::ColumnListGeoMultiPolygon
}
 

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 
ColumnGeoPoint 
ColumnGeoLineString 
ColumnGeoPolygon 
ColumnGeoMultiPoint 
ColumnGeoMultiLineString 
ColumnGeoMultiPolygon 
ColumnListGeoPoint 
ColumnListGeoLineString 
ColumnListGeoPolygon 
ColumnListGeoMultiPoint 
ColumnListGeoMultiLineString 
ColumnListGeoMultiPolygon 

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,
123 };
struct GeoLineStringStruct GeoLineString
Definition: heavydbTypes.h:999
struct GeoPointStruct GeoPoint
Definition: heavydbTypes.h:963
struct GeoMultiPointStruct GeoMultiPoint
Definition: heavydbTypes.h:981
struct GeoMultiLineStringStruct GeoMultiLineString
struct GeoMultiPolygonStruct GeoMultiPolygon
struct GeoPolygonStruct GeoPolygon

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: