OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExtensionFunctionsWhitelist Class Reference

#include <ExtensionFunctionsWhitelist.h>

Static Public Member Functions

static void add (const std::string &json_func_sigs)
 
static void addUdfs (const std::string &json_func_sigs)
 
static void clearRTUdfs ()
 
static void addRTUdfs (const std::string &json_func_sigs)
 
static std::vector
< ExtensionFunction > * 
get (const std::string &name)
 
static std::vector
< ExtensionFunction > * 
get_udf (const std::string &name)
 
static std::unordered_set
< std::string > 
get_udfs_name (const bool is_runtime)
 
static std::vector
< ExtensionFunction
get_ext_funcs (const std::string &name)
 
static std::vector
< ExtensionFunction
get_ext_funcs (const std::string &name, const bool is_gpu)
 
static std::vector
< ExtensionFunction
get_ext_funcs (const std::string &name, size_t arity)
 
static std::vector
< ExtensionFunction
get_ext_funcs (const std::string &name, size_t arity, const SQLTypeInfo &rtype)
 
static std::string toString (const std::vector< ExtensionFunction > &ext_funcs, std::string tab="")
 
static std::string toString (const std::vector< SQLTypeInfo > &arg_types)
 
static std::string toString (const std::vector< ExtArgumentType > &sig_types)
 
static std::string toStringSQL (const std::vector< ExtArgumentType > &sig_types)
 
static std::string toString (const ExtArgumentType &sig_type)
 
static std::string toStringSQL (const ExtArgumentType &sig_type)
 
static std::vector< std::string > getLLVMDeclarations (const std::unordered_set< std::string > &udf_decls, const bool is_gpu=false)
 

Static Private Member Functions

static void addCommon (std::unordered_map< std::string, std::vector< ExtensionFunction >> &sigs, const std::string &json_func_sigs, const bool is_runtime)
 

Static Private Attributes

static std::unordered_map
< std::string, std::vector
< ExtensionFunction > > 
functions_
 
static std::unordered_map
< std::string, std::vector
< ExtensionFunction > > 
udf_functions_
 
static std::unordered_map
< std::string, std::vector
< ExtensionFunction > > 
rt_udf_functions_
 

Detailed Description

Definition at line 171 of file ExtensionFunctionsWhitelist.h.

Member Function Documentation

void ExtensionFunctionsWhitelist::add ( const std::string &  json_func_sigs)
static

Definition at line 1074 of file ExtensionFunctionsWhitelist.cpp.

References addCommon(), and functions_.

Referenced by DBHandler::initialize(), and QueryRunner::QueryRunner::QueryRunner().

1074  {
1075  // Valid json_func_sigs example:
1076  // [
1077  // {
1078  // "name":"sum",
1079  // "ret":"i32",
1080  // "args":[
1081  // "i32",
1082  // "i32"
1083  // ]
1084  // }
1085  // ]
1086 
1087  addCommon(functions_, json_func_sigs, /* is_runtime */ false);
1088 }
static void addCommon(std::unordered_map< std::string, std::vector< ExtensionFunction >> &sigs, const std::string &json_func_sigs, const bool is_runtime)
static std::unordered_map< std::string, std::vector< ExtensionFunction > > functions_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ExtensionFunctionsWhitelist::addCommon ( std::unordered_map< std::string, std::vector< ExtensionFunction >> &  sigs,
const std::string &  json_func_sigs,
const bool  is_runtime 
)
staticprivate

Definition at line 1029 of file ExtensionFunctionsWhitelist.cpp.

References run_benchmark_import::args, CHECK, anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::deserialize_type(), anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::drop_suffix(), field(), json_str(), setup::name, and to_upper().

Referenced by add(), addRTUdfs(), and addUdfs().

1031  {
1032  rapidjson::Document func_sigs;
1033  func_sigs.Parse(json_func_sigs.c_str());
1034  CHECK(func_sigs.IsArray());
1035  for (auto func_sigs_it = func_sigs.Begin(); func_sigs_it != func_sigs.End();
1036  ++func_sigs_it) {
1037  CHECK(func_sigs_it->IsObject());
1038  const auto name = json_str(field(*func_sigs_it, "name"));
1039  const auto ret = deserialize_type(json_str(field(*func_sigs_it, "ret")));
1040  std::vector<ExtArgumentType> args;
1041  const auto& args_serialized = field(*func_sigs_it, "args");
1042  CHECK(args_serialized.IsArray());
1043  for (auto args_serialized_it = args_serialized.Begin();
1044  args_serialized_it != args_serialized.End();
1045  ++args_serialized_it) {
1046  args.push_back(deserialize_type(json_str(*args_serialized_it)));
1047  }
1048 
1049  std::vector<std::map<std::string, std::string>> annotations;
1050  const auto& anns = field(*func_sigs_it, "annotations");
1051  CHECK(anns.IsArray());
1052  static const std::map<std::string, std::string> map_empty = {};
1053  for (auto obj = anns.Begin(); obj != anns.End(); ++obj) {
1054  CHECK(obj->IsObject());
1055  if (obj->ObjectEmpty()) {
1056  annotations.push_back(map_empty);
1057  } else {
1058  std::map<std::string, std::string> m;
1059  for (auto kv = obj->MemberBegin(); kv != obj->MemberEnd(); ++kv) {
1060  m[kv->name.GetString()] = kv->value.GetString();
1061  }
1062  annotations.push_back(m);
1063  }
1064  }
1065  signatures[to_upper(drop_suffix(name))].emplace_back(
1066  name, args, ret, annotations, is_runtime);
1067  }
1068 }
const std::string json_str(const rapidjson::Value &obj) noexcept
Definition: JsonAccessors.h:46
const rapidjson::Value & field(const rapidjson::Value &obj, const char field[]) noexcept
Definition: JsonAccessors.h:33
ExtArgumentType deserialize_type(const std::string &type_name)
std::string to_upper(const std::string &str)
#define CHECK(condition)
Definition: Logger.h:291
string name
Definition: setup.in.py:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ExtensionFunctionsWhitelist::addRTUdfs ( const std::string &  json_func_sigs)
static

Definition at line 1100 of file ExtensionFunctionsWhitelist.cpp.

References addCommon(), and rt_udf_functions_.

Referenced by DBHandler::register_runtime_extension_functions().

1100  {
1101  if (!json_func_sigs.empty()) {
1102  addCommon(rt_udf_functions_, json_func_sigs, /* is_runtime */ true);
1103  }
1104 }
static void addCommon(std::unordered_map< std::string, std::vector< ExtensionFunction >> &sigs, const std::string &json_func_sigs, const bool is_runtime)
static std::unordered_map< std::string, std::vector< ExtensionFunction > > rt_udf_functions_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ExtensionFunctionsWhitelist::addUdfs ( const std::string &  json_func_sigs)
static

Definition at line 1090 of file ExtensionFunctionsWhitelist.cpp.

References addCommon(), and udf_functions_.

Referenced by DBHandler::initialize(), and QueryRunner::QueryRunner::QueryRunner().

1090  {
1091  if (!json_func_sigs.empty()) {
1092  addCommon(udf_functions_, json_func_sigs, /* is_runtime */ false);
1093  }
1094 }
static void addCommon(std::unordered_map< std::string, std::vector< ExtensionFunction >> &sigs, const std::string &json_func_sigs, const bool is_runtime)
static std::unordered_map< std::string, std::vector< ExtensionFunction > > udf_functions_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ExtensionFunctionsWhitelist::clearRTUdfs ( )
static

Definition at line 1096 of file ExtensionFunctionsWhitelist.cpp.

References rt_udf_functions_.

Referenced by DBHandler::register_runtime_extension_functions().

1096  {
1097  rt_udf_functions_.clear();
1098 }
static std::unordered_map< std::string, std::vector< ExtensionFunction > > rt_udf_functions_

+ Here is the caller graph for this function:

std::vector< ExtensionFunction > * ExtensionFunctionsWhitelist::get ( const std::string &  name)
static

Definition at line 28 of file ExtensionFunctionsWhitelist.cpp.

References functions_, and to_upper().

29  {
30  const auto it = functions_.find(to_upper(name));
31  if (it == functions_.end()) {
32  return nullptr;
33  }
34  return &it->second;
35 }
static std::unordered_map< std::string, std::vector< ExtensionFunction > > functions_
std::string to_upper(const std::string &str)
string name
Definition: setup.in.py:72

+ Here is the call graph for this function:

std::vector< ExtensionFunction > ExtensionFunctionsWhitelist::get_ext_funcs ( const std::string &  name)
static

Definition at line 62 of file ExtensionFunctionsWhitelist.cpp.

References gpu_enabled::copy(), functions_, rt_udf_functions_, to_upper(), and udf_functions_.

Referenced by bind_function(), ShowFunctionsCommand::execute(), and DBHandler::get_function_details().

63  {
64  std::vector<ExtensionFunction> ext_funcs = {};
65  const auto collections = {&functions_, &udf_functions_, &rt_udf_functions_};
66  const auto uname = to_upper(name);
67  for (auto funcs : collections) {
68  const auto it = funcs->find(uname);
69  if (it == funcs->end()) {
70  continue;
71  }
72  auto ext_func_sigs = it->second;
73  std::copy(ext_func_sigs.begin(), ext_func_sigs.end(), std::back_inserter(ext_funcs));
74  }
75  return ext_funcs;
76 }
static std::unordered_map< std::string, std::vector< ExtensionFunction > > udf_functions_
static std::unordered_map< std::string, std::vector< ExtensionFunction > > rt_udf_functions_
static std::unordered_map< std::string, std::vector< ExtensionFunction > > functions_
DEVICE auto copy(ARGS &&...args)
Definition: gpu_enabled.h:51
std::string to_upper(const std::string &str)
string name
Definition: setup.in.py:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector< ExtensionFunction > ExtensionFunctionsWhitelist::get_ext_funcs ( const std::string &  name,
const bool  is_gpu 
)
static

Definition at line 78 of file ExtensionFunctionsWhitelist.cpp.

References functions_, rt_udf_functions_, to_upper(), and udf_functions_.

80  {
81  std::vector<ExtensionFunction> ext_funcs = {};
82  const auto collections = {&functions_, &udf_functions_, &rt_udf_functions_};
83  const auto uname = to_upper(name);
84  for (auto funcs : collections) {
85  const auto it = funcs->find(uname);
86  if (it == funcs->end()) {
87  continue;
88  }
89  auto ext_func_sigs = it->second;
90  std::copy_if(ext_func_sigs.begin(),
91  ext_func_sigs.end(),
92  std::back_inserter(ext_funcs),
93  [is_gpu](auto sig) { return (is_gpu ? sig.isGPU() : sig.isCPU()); });
94  }
95  return ext_funcs;
96 }
static std::unordered_map< std::string, std::vector< ExtensionFunction > > udf_functions_
static std::unordered_map< std::string, std::vector< ExtensionFunction > > rt_udf_functions_
static std::unordered_map< std::string, std::vector< ExtensionFunction > > functions_
std::string to_upper(const std::string &str)
string name
Definition: setup.in.py:72

+ Here is the call graph for this function:

std::vector< ExtensionFunction > ExtensionFunctionsWhitelist::get_ext_funcs ( const std::string &  name,
size_t  arity 
)
static

Definition at line 98 of file ExtensionFunctionsWhitelist.cpp.

References functions_, rt_udf_functions_, to_upper(), and udf_functions_.

100  {
101  std::vector<ExtensionFunction> ext_funcs = {};
102  const auto collections = {&functions_, &udf_functions_, &rt_udf_functions_};
103  const auto uname = to_upper(name);
104  for (auto funcs : collections) {
105  const auto it = funcs->find(uname);
106  if (it == funcs->end()) {
107  continue;
108  }
109  auto ext_func_sigs = it->second;
110  std::copy_if(ext_func_sigs.begin(),
111  ext_func_sigs.end(),
112  std::back_inserter(ext_funcs),
113  [arity](auto sig) { return arity == sig.getInputArgs().size(); });
114  }
115  return ext_funcs;
116 }
static std::unordered_map< std::string, std::vector< ExtensionFunction > > udf_functions_
static std::unordered_map< std::string, std::vector< ExtensionFunction > > rt_udf_functions_
static std::unordered_map< std::string, std::vector< ExtensionFunction > > functions_
std::string to_upper(const std::string &str)
string name
Definition: setup.in.py:72

+ Here is the call graph for this function:

std::vector< ExtensionFunction > ExtensionFunctionsWhitelist::get_ext_funcs ( const std::string &  name,
size_t  arity,
const SQLTypeInfo rtype 
)
static

Definition at line 118 of file ExtensionFunctionsWhitelist.cpp.

References ext_arg_type_to_type_info(), functions_, SQLTypeInfo::get_type(), kBOOLEAN, kTINYINT, rt_udf_functions_, to_upper(), and udf_functions_.

121  {
122  std::vector<ExtensionFunction> ext_funcs = {};
123  const auto collections = {&functions_, &udf_functions_, &rt_udf_functions_};
124  const auto uname = to_upper(name);
125  for (auto funcs : collections) {
126  const auto it = funcs->find(uname);
127  if (it == funcs->end()) {
128  continue;
129  }
130  auto ext_func_sigs = it->second;
131  std::copy_if(ext_func_sigs.begin(),
132  ext_func_sigs.end(),
133  std::back_inserter(ext_funcs),
134  [arity, rtype](auto sig) {
135  // Ideally, arity should be equal to the number of
136  // sig arguments but there seems to be many cases
137  // where some sig arguments will be represented
138  // with multiple arguments, for instance, array
139  // argument is translated to data pointer and array
140  // size arguments.
141  if (arity > sig.getInputArgs().size()) {
142  return false;
143  }
144  auto rt = rtype.get_type();
145  auto st = ext_arg_type_to_type_info(sig.getRet()).get_type();
146  return (st == rt || (st == kTINYINT && rt == kBOOLEAN));
147  });
148  }
149  return ext_funcs;
150 }
static std::unordered_map< std::string, std::vector< ExtensionFunction > > udf_functions_
static std::unordered_map< std::string, std::vector< ExtensionFunction > > rt_udf_functions_
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
static std::unordered_map< std::string, std::vector< ExtensionFunction > > functions_
std::string to_upper(const std::string &str)
string name
Definition: setup.in.py:72
SQLTypeInfo ext_arg_type_to_type_info(const ExtArgumentType ext_arg_type)

+ Here is the call graph for this function:

std::vector< ExtensionFunction > * ExtensionFunctionsWhitelist::get_udf ( const std::string &  name)
static

Definition at line 37 of file ExtensionFunctionsWhitelist.cpp.

References to_upper(), and udf_functions_.

38  {
39  const auto it = udf_functions_.find(to_upper(name));
40  if (it == udf_functions_.end()) {
41  return nullptr;
42  }
43  return &it->second;
44 }
static std::unordered_map< std::string, std::vector< ExtensionFunction > > udf_functions_
std::string to_upper(const std::string &str)
string name
Definition: setup.in.py:72

+ Here is the call graph for this function:

std::unordered_set< std::string > ExtensionFunctionsWhitelist::get_udfs_name ( const bool  is_runtime)
static

Definition at line 47 of file ExtensionFunctionsWhitelist.cpp.

References functions_, ExtensionFunction::getName(), ExtensionFunction::isRuntime(), rt_udf_functions_, and udf_functions_.

Referenced by ShowFunctionsCommand::execute(), ShowRuntimeFunctionsCommand::execute(), DBHandler::get_function_names(), and DBHandler::get_runtime_function_names().

48  {
49  std::unordered_set<std::string> names;
50  const auto collections = {&functions_, &udf_functions_, &rt_udf_functions_};
51  for (auto funcs : collections) {
52  for (auto& pair : *funcs) {
53  ExtensionFunction udf = pair.second.at(0);
54  if (udf.isRuntime() == is_runtime) {
55  names.insert(udf.getName(/* keep_suffix */ false));
56  }
57  }
58  }
59  return names;
60 }
static std::unordered_map< std::string, std::vector< ExtensionFunction > > udf_functions_
static std::unordered_map< std::string, std::vector< ExtensionFunction > > rt_udf_functions_
const std::string getName(bool keep_suffix=true) const
static std::unordered_map< std::string, std::vector< ExtensionFunction > > functions_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector< std::string > ExtensionFunctionsWhitelist::getLLVMDeclarations ( const std::unordered_set< std::string > &  udf_decls,
const bool  is_gpu = false 
)
static

Definition at line 709 of file ExtensionFunctionsWhitelist.cpp.

References CHECK, functions_, table_functions::TableFunctionsFactory::functions_, Int32, is_ext_arg_type_array(), join(), and anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::serialize_type().

711  {
712  std::vector<std::string> declarations;
713  for (const auto& kv : functions_) {
714  const std::vector<ExtensionFunction>& ext_funcs = kv.second;
715  CHECK(!ext_funcs.empty());
716  for (const auto& ext_func : ext_funcs) {
717  // If there is a udf function declaration matching an extension function signature
718  // do not emit a duplicate declaration.
719  if (!udf_decls.empty() && udf_decls.find(ext_func.getName()) != udf_decls.end()) {
720  continue;
721  }
722 
723  std::string decl_prefix;
724  std::vector<std::string> arg_strs;
725 
726  if (is_ext_arg_type_array(ext_func.getRet())) {
727  decl_prefix = "declare void @" + ext_func.getName();
728  arg_strs.emplace_back(
729  serialize_type(ext_func.getRet(), /* byval */ true, /* declare */ true));
730  } else {
731  decl_prefix =
732  "declare " +
733  serialize_type(ext_func.getRet(), /* byval */ true, /* declare */ true) +
734  " @" + ext_func.getName();
735  }
736 
737  // if the extension function uses a Row Function Manager, append "i8*" as the first
738  // arg
739  if (ext_func.usesManager()) {
740  arg_strs.emplace_back("i8*");
741  }
742 
743  for (const auto arg : ext_func.getInputArgs()) {
744  arg_strs.emplace_back(serialize_type(arg, /* byval */ false, /* declare */ true));
745  }
746  declarations.emplace_back(decl_prefix + "(" +
747  boost::algorithm::join(arg_strs, ", ") + ");");
748  }
749  }
750 
752  if (kv.second.isRuntime() || kv.second.useDefaultSizer()) {
753  // Runtime UDTFs are defined in LLVM/NVVM IR module
754  // UDTFs using default sizer share LLVM IR
755  continue;
756  }
757  if (!((is_gpu && kv.second.isGPU()) || (!is_gpu && kv.second.isCPU()))) {
758  continue;
759  }
760  std::string decl_prefix{
761  "declare " +
762  serialize_type(ExtArgumentType::Int32, /* byval */ true, /* declare */ true) +
763  " @" + kv.first};
764  std::vector<std::string> arg_strs;
765  for (const auto arg : kv.second.getArgs(/* ensure_column = */ true)) {
766  arg_strs.push_back(
767  serialize_type(arg, /* byval= */ kv.second.isRuntime(), /* declare= */ true));
768  }
769  declarations.push_back(decl_prefix + "(" + boost::algorithm::join(arg_strs, ", ") +
770  ");");
771  }
772  return declarations;
773 }
std::string join(T const &container, std::string const &delim)
static std::unordered_map< std::string, std::vector< ExtensionFunction > > functions_
bool is_ext_arg_type_array(const ExtArgumentType ext_arg_type)
std::string serialize_type(const ExtArgumentType type, bool byval=true, bool declare=false)
#define CHECK(condition)
Definition: Logger.h:291
static std::unordered_map< std::string, TableFunction > functions_

+ Here is the call graph for this function:

std::string ExtensionFunctionsWhitelist::toString ( const std::vector< ExtensionFunction > &  ext_funcs,
std::string  tab = "" 
)
static

Definition at line 443 of file ExtensionFunctionsWhitelist.cpp.

Referenced by bind_function(), table_functions::TableFunction::getArgTypes(), table_functions::TableFunction::getSignature(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), ExtensionFunction::toSignature(), ExtensionFunction::toString(), toString(), and table_functions::TableFunction::toString().

445  {
446  std::string r = "";
447  for (auto sig : ext_funcs) {
448  r += tab + sig.toString() + "\n";
449  }
450  return r;
451 }

+ Here is the caller graph for this function:

std::string ExtensionFunctionsWhitelist::toString ( const std::vector< SQLTypeInfo > &  arg_types)
static

Definition at line 453 of file ExtensionFunctionsWhitelist.cpp.

454  {
455  std::string r = "";
456  for (auto sig = arg_types.begin(); sig != arg_types.end();) {
457  r += sig->get_type_name();
458  sig++;
459  if (sig != arg_types.end()) {
460  r += ", ";
461  }
462  }
463  return r;
464 }
std::string ExtensionFunctionsWhitelist::toString ( const std::vector< ExtArgumentType > &  sig_types)
static

Definition at line 466 of file ExtensionFunctionsWhitelist.cpp.

References anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::serialize_type().

467  {
468  std::string r = "";
469  for (auto t = sig_types.begin(); t != sig_types.end();) {
470  r += serialize_type(*t, /* byval */ false, /* declare */ false);
471  t++;
472  if (t != sig_types.end()) {
473  r += ", ";
474  }
475  }
476  return r;
477 }
std::string serialize_type(const ExtArgumentType type, bool byval=true, bool declare=false)

+ Here is the call graph for this function:

std::string ExtensionFunctionsWhitelist::toString ( const ExtArgumentType sig_type)
static

Definition at line 492 of file ExtensionFunctionsWhitelist.cpp.

References anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::serialize_type().

492  {
493  return serialize_type(sig_type, /* byval */ false, /* declare */ false);
494 }
std::string serialize_type(const ExtArgumentType type, bool byval=true, bool declare=false)

+ Here is the call graph for this function:

std::string ExtensionFunctionsWhitelist::toStringSQL ( const std::vector< ExtArgumentType > &  sig_types)
static

Definition at line 479 of file ExtensionFunctionsWhitelist.cpp.

Referenced by ExtensionFunction::toStringSQL(), and table_functions::TableFunction::toStringSQL().

480  {
481  std::string r = "";
482  for (auto t = sig_types.begin(); t != sig_types.end();) {
484  t++;
485  if (t != sig_types.end()) {
486  r += ", ";
487  }
488  }
489  return r;
490 }
static std::string toStringSQL(const std::vector< ExtArgumentType > &sig_types)

+ Here is the caller graph for this function:

std::string ExtensionFunctionsWhitelist::toStringSQL ( const ExtArgumentType sig_type)
static

Definition at line 496 of file ExtensionFunctionsWhitelist.cpp.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, ArrayTextEncodingDict, ArrayTextEncodingNone, Bool, ColumnArrayBool, ColumnArrayDouble, ColumnArrayFloat, ColumnArrayInt16, ColumnArrayInt32, ColumnArrayInt64, ColumnArrayInt8, ColumnArrayTextEncodingDict, ColumnArrayTextEncodingNone, ColumnBool, ColumnDouble, ColumnFloat, ColumnGeoLineString, ColumnGeoMultiLineString, ColumnGeoMultiPoint, ColumnGeoMultiPolygon, ColumnGeoPoint, ColumnGeoPolygon, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, ColumnListArrayBool, ColumnListArrayDouble, ColumnListArrayFloat, ColumnListArrayInt16, ColumnListArrayInt32, ColumnListArrayInt64, ColumnListArrayInt8, ColumnListArrayTextEncodingDict, ColumnListArrayTextEncodingNone, ColumnListBool, ColumnListDouble, ColumnListFloat, ColumnListGeoLineString, ColumnListGeoMultiLineString, ColumnListGeoMultiPoint, ColumnListGeoMultiPolygon, ColumnListGeoPoint, ColumnListGeoPolygon, ColumnListInt16, ColumnListInt32, ColumnListInt64, ColumnListInt8, ColumnListTextEncodingDict, ColumnListTextEncodingNone, ColumnTextEncodingDict, ColumnTextEncodingNone, ColumnTimestamp, Cursor, DayTimeInterval, Double, Float, GeoLineString, GeoMultiLineString, GeoMultiPoint, GeoMultiPolygon, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, TextEncodingDict, TextEncodingNone, Timestamp, UNREACHABLE, Void, and YearMonthTimeInterval.

496  {
497  switch (sig_type) {
499  return "TINYINT";
501  return "SMALLINT";
503  return "INTEGER";
505  return "BIGINT";
507  return "FLOAT";
509  return "DOUBLE";
511  return "BOOLEAN";
513  return "TINYINT[]";
515  return "SMALLINT[]";
517  return "INT[]";
519  return "BIGINT[]";
521  return "FLOAT[]";
523  return "DOUBLE[]";
525  return "BOOLEAN[]";
527  return "ARRAY<TINYINT>";
529  return "ARRAY<SMALLINT>";
531  return "ARRAY<INT>";
533  return "ARRAY<BIGINT>";
535  return "ARRAY<FLOAT>";
537  return "ARRAY<DOUBLE>";
539  return "ARRAY<BOOLEAN>";
541  return "ARRAY<TEXT ENCODING DICT>";
543  return "ARRAY<TEXT ENCODING NONE>";
545  return "COLUMN<TINYINT>";
547  return "COLUMN<SMALLINT>";
549  return "COLUMN<INT>";
551  return "COLUMN<BIGINT>";
553  return "COLUMN<FLOAT>";
555  return "COLUMN<DOUBLE>";
557  return "COLUMN<BOOLEAN>";
559  return "COLUMN<TEXT ENCODING DICT>";
561  return "COLUMN<TEXT ENCODING NONE>";
563  return "COLUMN<TIMESTAMP(9)>";
565  return "CURSOR";
567  return "POINT";
569  return "MULTIPOINT";
571  return "LINESTRING";
573  return "MULTILINESTRING";
575  return "POLYGON";
577  return "MULTIPOLYGON";
579  return "VOID";
581  return "TEXT ENCODING NONE";
583  return "TEXT ENCODING DICT";
585  return "TIMESTAMP(9)";
587  return "COLUMNLIST<TINYINT>";
589  return "COLUMNLIST<SMALLINT>";
591  return "COLUMNLIST<INT>";
593  return "COLUMNLIST<BIGINT>";
595  return "COLUMNLIST<FLOAT>";
597  return "COLUMNLIST<DOUBLE>";
599  return "COLUMNLIST<BOOLEAN>";
601  return "COLUMNLIST<TEXT ENCODING DICT>";
603  return "COLUMNLIST<TEXT ENCODING NONE>";
605  return "COLUMN<ARRAY<TINYINT>>";
607  return "COLUMN<ARRAY<SMALLINT>>";
609  return "COLUMN<ARRAY<INT>>";
611  return "COLUMN<ARRAY<BIGINT>>";
613  return "COLUMN<ARRAY<FLOAT>>";
615  return "COLUMN<ARRAY<DOUBLE>>";
617  return "COLUMN<ARRAY<BOOLEAN>>";
619  return "COLUMN<ARRAY<TEXT ENCODING DICT>>";
621  return "COLUMN<ARRAY<TEXT ENCODING NONE>>";
623  return "COLUMNLIST<ARRAY<TINYINT>>";
625  return "COLUMNLIST<ARRAY<SMALLINT>>";
627  return "COLUMNLIST<ARRAY<INT>>";
629  return "COLUMNLIST<ARRAY<BIGINT>>";
631  return "COLUMNLIST<ARRAY<FLOAT>>";
633  return "COLUMNLIST<ARRAY<DOUBLE>>";
635  return "COLUMNLIST<ARRAY<BOOLEAN>>";
637  return "COLUMNLIST<ARRAY<TEXT ENCODING DICT>>";
639  return "COLUMNLIST<ARRAY<TEXT ENCODING NONE>>";
641  return "DAY TIME INTERVAL";
643  return "YEAR MONTH INTERVAL";
645  return "COLUMN<GEOPOINT>";
647  return "COLUMN<GEOLINESTRING>";
649  return "COLUMN<GEOPOLYGON>";
651  return "COLUMN<GEOMULTIPOINT>";
653  return "COLUMN<GEOMULTILINESTRING>";
655  return "COLUMN<GEOMULTIPOLYGON>";
657  return "COLUMNLIST<GEOPOINT>";
659  return "COLUMNLIST<GEOLINESTRING>";
661  return "COLUMNLIST<GEOPOLYGON>";
663  return "COLUMNLIST<GEOMULTIPOINT>";
665  return "COLUMNLIST<GEOMULTILINESTRING>";
667  return "COLUMNLIST<GEOMULTIPOLYGON>";
668  default:
669  UNREACHABLE() << " sig_type=" << static_cast<int>(sig_type);
670  }
671  return "";
672 }
#define UNREACHABLE()
Definition: Logger.h:338

Member Data Documentation

std::unordered_map< std::string, std::vector< ExtensionFunction > > ExtensionFunctionsWhitelist::functions_
staticprivate
std::unordered_map< std::string, std::vector< ExtensionFunction > > ExtensionFunctionsWhitelist::rt_udf_functions_
staticprivate
std::unordered_map< std::string, std::vector< ExtensionFunction > > ExtensionFunctionsWhitelist::udf_functions_
staticprivate

Definition at line 220 of file ExtensionFunctionsWhitelist.h.

Referenced by addUdfs(), get_ext_funcs(), get_udf(), and get_udfs_name().


The documentation for this class was generated from the following files: