OmniSciDB  2c44a3935d
ExtensionFunctionsWhitelist.h File Reference
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "../Shared/sqltypes.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
}
 

Functions

SQLTypeInfo ext_arg_type_to_type_info (const ExtArgumentType ext_arg_type)
 

Enumeration Type Documentation

◆ ExtArgumentType

Function Documentation

◆ ext_arg_type_to_type_info()

SQLTypeInfo ext_arg_type_to_type_info ( const ExtArgumentType  ext_arg_type)

Definition at line 183 of file ExtensionFunctionsWhitelist.cpp.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, Bool, Double, Float, Int16, Int32, Int64, Int8, kARRAY, kBIGINT, kBOOLEAN, kDOUBLE, kFLOAT, kINT, kNULLT, kSMALLINT, kTINYINT, LOG, anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::serialize_type(), and logger::WARNING.

Referenced by bind_function(), CodeGenerator::codegenFunctionOperCastArgs(), ExtensionFunctionsWhitelist::get_ext_funcs(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), and RelAlgTranslator::translateFunction().

183  {
184  /* This function is mostly used for scalar types.
185  For non-scalar types, NULL is returned as a placeholder.
186  */
187 
188  auto generate_array_type = [](const auto subtype) {
189  auto ti = SQLTypeInfo(kARRAY, false);
190  ti.set_subtype(subtype);
191  return ti;
192  };
193 
194  switch (ext_arg_type) {
196  return SQLTypeInfo(kBOOLEAN, false);
198  return SQLTypeInfo(kTINYINT, false);
200  return SQLTypeInfo(kSMALLINT, false);
202  return SQLTypeInfo(kINT, false);
204  return SQLTypeInfo(kBIGINT, false);
206  return SQLTypeInfo(kFLOAT, false);
208  return SQLTypeInfo(kDOUBLE, false);
210  return generate_array_type(kTINYINT);
212  return generate_array_type(kSMALLINT);
214  return generate_array_type(kINT);
216  return generate_array_type(kBIGINT);
218  return generate_array_type(kFLOAT);
220  return generate_array_type(kDOUBLE);
222  return generate_array_type(kBOOLEAN);
223  default:
224  LOG(WARNING) << "ExtArgumentType `" << serialize_type(ext_arg_type)
225  << "` cannot be converted to SQLTypeInfo. Returning nulltype.";
226  }
227  return SQLTypeInfo(kNULLT, false);
228 }
#define LOG(tag)
Definition: Logger.h:188
Definition: sqltypes.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function: