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

Public Member Functions

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

Detailed Description

Definition at line 193 of file TargetValueConvertersFactories.cpp.

Member Function Documentation

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

Definition at line 194 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.

194  {
195  const static std::map<std::tuple<SQLTypes, EncodingType>,
196  std::function<std::unique_ptr<TargetValueConverter>(
197  ConverterCreateParameter param)>>
198  array_converter_factories{
201  {{kINT, kENCODING_NONE},
213  {{kDATE, kENCODING_NONE},
215  {{kTIME, kENCODING_NONE},
223  {{kTEXT, kENCODING_DICT},
225  {{kCHAR, kENCODING_DICT},
229 
230  auto elem_type = param.target->columnType.get_elem_type();
231  auto factory = array_converter_factories.find(
232  {elem_type.get_type(), elem_type.get_compression()});
233 
234  if (factory != array_converter_factories.end()) {
235  return factory->second(param);
236  }
237 
238  throw std::runtime_error("Unsupported array column type");
239  }
Definition: sqltypes.h:51
Definition: sqltypes.h:54
Definition: sqltypes.h:55
Definition: sqltypes.h:43
Definition: sqltypes.h:47
SQLTypeInfo columnType
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:624

+ Here is the call graph for this function:


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