ClickHouse/dbms/src/Dictionaries/ComplexKeyCacheDictionary_generate3.cpp.in
proller dd2371e071 CLICKHOUSE-4137 DictionaryFactory, DictionarySourceFactory (#3653)
* Split ComplexKeyCacheDictionary to faster compile (part2)

* Dictionaries as lib WIP

* wip

* clean

* Fix build with old capnp

* fix

* wip

* fixes

* fix

* clean

* clean

* clean

* wip

* wip

* wip

* flat

* wip

* cache

* clean

* wip

* faster

* fix style

* fixes

* clean

* clean

* Split CacheDictionary.cpp for faster compile

* fix

* fix

* Less memory usage while compiling

* missing file

* format

* Update registerDictionaries.h

* clean
2018-11-28 14:37:12 +03:00

28 lines
822 B
C++

#include <Dictionaries/ComplexKeyCacheDictionary.h>
namespace DB
{
namespace ErrorCodes
{
extern const int TYPE_MISMATCH;
}
using TYPE = @NAME@;
void ComplexKeyCacheDictionary::get@NAME@(const std::string & attribute_name,
const Columns & key_columns,
const DataTypes & key_types,
const TYPE def,
ResultArrayType<TYPE> & out) const
{
dict_struct.validateKeyTypes(key_types);
auto & attribute = getAttribute(attribute_name);
if (!isAttributeTypeConvertibleTo(attribute.type, AttributeUnderlyingType::@NAME@))
throw Exception {name + ": type mismatch: attribute " + attribute_name + " has type " + toString(attribute.type),
ErrorCodes::TYPE_MISMATCH};
getItemsNumber<TYPE>(attribute, key_columns, out, [&](const size_t) { return def; });
}
}