OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TextConverterFactory Struct Reference

Public Member Functions

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

Detailed Description

Definition at line 138 of file TargetValueConvertersFactories.cpp.

Member Function Documentation

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

Definition at line 139 of file TargetValueConvertersFactories.cpp.

References ColumnDescriptor::columnType, DictionaryConverterFactory< TARGET_TYPE >::create(), SQLTypeInfo::get_compression(), SQLTypeInfo::get_size(), TargetMetaInfo::get_type_info(), SQLTypeInfo::getStringDictKey(), kENCODING_DICT, kENCODING_NONE, ConverterCreateParameter::literals_dictionary, ConverterCreateParameter::num_rows, ConverterCreateParameter::source, and ConverterCreateParameter::target.

139  {
141  bool dictEncodedSource =
143  shared::StringDictKey source_dict_key;
144  if (dictEncodedSource) {
145  source_dict_key = param.source.get_type_info().getStringDictKey();
146  }
147  return std::make_unique<StringValueConverter>(param.target,
148  param.num_rows,
149  dictEncodedSource,
150  source_dict_key,
151  param.literals_dictionary);
152  } else if (param.target->columnType.get_compression() == kENCODING_DICT) {
153  auto size = param.target->columnType.get_size();
154  if (4 == size) {
156  return factory.create(param);
157  } else if (2 == size) {
159  return factory.create(param);
160  } else if (1 == size) {
162  return factory.create(param);
163  }
164  }
165 
166  throw std::runtime_error("Unsupported text column type");
167  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:403
StringDictionaryProxy * literals_dictionary
const SQLTypeInfo & get_type_info() const
std::unique_ptr< ConverterType > create(ConverterCreateParameter param)
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
SQLTypeInfo columnType
const shared::StringDictKey & getStringDictKey() const
Definition: sqltypes.h:1055

+ Here is the call graph for this function:


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