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

Public Member Functions

std::unique_ptr
< TargetValueConverter
operator() (ConverterCreateParameter param)
 

Detailed Description

Definition at line 195 of file TargetValueConvertersFactories.cpp.

Member Function Documentation

std::unique_ptr<TargetValueConverter> ArraysConverterFactory::operator() ( ConverterCreateParameter  param)
inline

Definition at line 196 of file TargetValueConvertersFactories.cpp.

References ColumnDescriptor::columnType, SQLTypeInfo::get_elem_type(), kBIGINT, kBOOLEAN, kCHAR, kDATE, kDECIMAL, kDOUBLE, kENCODING_DICT, kENCODING_NONE, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, and ConverterCreateParameter::target.

196  {
197  const static std::map<std::tuple<SQLTypes, EncodingType>,
198  std::function<std::unique_ptr<TargetValueConverter>(
199  ConverterCreateParameter param)>>
200  array_converter_factories{
203  {{kINT, kENCODING_NONE},
215  {{kDATE, kENCODING_NONE},
217  {{kTIME, kENCODING_NONE},
225  {{kTEXT, kENCODING_DICT},
227  {{kCHAR, kENCODING_DICT},
231 
232  auto elem_type = param.target->columnType.get_elem_type();
233  auto factory = array_converter_factories.find(
234  {elem_type.get_type(), elem_type.get_compression()});
235 
236  if (factory != array_converter_factories.end()) {
237  return factory->second(param);
238  }
239 
240  throw std::runtime_error("Unsupported array column type");
241  }
Definition: sqltypes.h:76
Definition: sqltypes.h:79
Definition: sqltypes.h:80
Definition: sqltypes.h:68
Definition: sqltypes.h:72
SQLTypeInfo columnType
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:977

+ Here is the call graph for this function:


The documentation for this struct was generated from the following file: