mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-09 18:10:48 +00:00
dd2371e071
* 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
28 lines
822 B
C++
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; });
|
|
}
|
|
}
|