OmniSciDB  1dac507f6e
 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 171 of file TargetValueConvertersFactories.cpp.

Member Function Documentation

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

Definition at line 172 of file TargetValueConvertersFactories.cpp.

References ColumnDescriptor::columnType, SQLTypeInfoCore< TYPE_FACET_PACK >::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.

172  {
173  const static std::map<std::tuple<SQLTypes, EncodingType>,
174  std::function<std::unique_ptr<TargetValueConverter>(
175  ConverterCreateParameter param)>>
176  array_converter_factories{
179  {{kINT, kENCODING_NONE},
191  {{kDATE, kENCODING_NONE},
193  {{kTIME, kENCODING_NONE},
201  {{kTEXT, kENCODING_DICT},
203  {{kCHAR, kENCODING_DICT},
207 
208  auto elem_type = param.target->columnType.get_elem_type();
209  auto factory = array_converter_factories.find(
210  {elem_type.get_type(), elem_type.get_compression()});
211 
212  if (factory != array_converter_factories.end()) {
213  return factory->second(param);
214  }
215 
216  throw std::runtime_error("Unsupported array column type");
217  }
Definition: sqltypes.h:52
Definition: sqltypes.h:55
Definition: sqltypes.h:56
Definition: sqltypes.h:44
Definition: sqltypes.h:48
SQLTypeInfoCore get_elem_type() const
Definition: sqltypes.h:659
SQLTypeInfo columnType

+ Here is the call graph for this function:


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