OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TextConverterFactory Struct Reference

Public Member Functions

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

Detailed Description

Definition at line 116 of file TargetValueConvertersFactories.cpp.

Member Function Documentation

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

Definition at line 117 of file TargetValueConvertersFactories.cpp.

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

117  {
119  bool dictEncodedSource =
121  auto sourceDictId = param.source.get_type_info().get_comp_param();
122  return std::make_unique<StringValueConverter>(param.cat,
123  param.target,
124  param.num_rows,
125  dictEncodedSource,
126  sourceDictId,
127  param.literals_dictionary);
128  } else if (param.target->columnType.get_compression() == kENCODING_DICT) {
129  auto size = param.target->columnType.get_size();
130  if (4 == size) {
132  return factory.create(param);
133  } else if (2 == size) {
135  return factory.create(param);
136  } else if (1 == size) {
138  return factory.create(param);
139  }
140  }
141 
142  throw std::runtime_error("Unsupported text column type");
143  }
const Catalog_Namespace::Catalog & cat
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:334
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:335
StringDictionaryProxy * literals_dictionary
HOST DEVICE int get_size() const
Definition: sqltypes.h:336
const SQLTypeInfo & get_type_info() const
std::unique_ptr< ConverterType > create(ConverterCreateParameter param)
SQLTypeInfo columnType

+ Here is the call graph for this function:


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