mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 10:02:01 +00:00
dbms:rename ComplexKeyDictionary to ComplexKeyHashedDictionary [#METR-17328]
This commit is contained in:
parent
a863b2b0a4
commit
c0ba6bedcb
@ -15,10 +15,10 @@
|
|||||||
namespace DB
|
namespace DB
|
||||||
{
|
{
|
||||||
|
|
||||||
class ComplexKeyDictionary final : public IDictionaryBase
|
class ComplexKeyHashedDictionary final : public IDictionaryBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ComplexKeyDictionary(
|
ComplexKeyHashedDictionary(
|
||||||
const std::string & name, const DictionaryStructure & dict_struct, DictionarySourcePtr source_ptr,
|
const std::string & name, const DictionaryStructure & dict_struct, DictionarySourcePtr source_ptr,
|
||||||
const DictionaryLifetime dict_lifetime, bool require_nonempty)
|
const DictionaryLifetime dict_lifetime, bool require_nonempty)
|
||||||
: name{name}, dict_struct(dict_struct), source_ptr{std::move(source_ptr)}, dict_lifetime(dict_lifetime),
|
: name{name}, dict_struct(dict_struct), source_ptr{std::move(source_ptr)}, dict_lifetime(dict_lifetime),
|
||||||
@ -39,8 +39,8 @@ public:
|
|||||||
creation_time = std::chrono::system_clock::now();
|
creation_time = std::chrono::system_clock::now();
|
||||||
}
|
}
|
||||||
|
|
||||||
ComplexKeyDictionary(const ComplexKeyDictionary & other)
|
ComplexKeyHashedDictionary(const ComplexKeyHashedDictionary & other)
|
||||||
: ComplexKeyDictionary{other.name, other.dict_struct, other.source_ptr->clone(), other.dict_lifetime, other.require_nonempty}
|
: ComplexKeyHashedDictionary{other.name, other.dict_struct, other.source_ptr->clone(), other.dict_lifetime, other.require_nonempty}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
std::string getKeyDescription() const { return key_description; };
|
std::string getKeyDescription() const { return key_description; };
|
||||||
@ -49,7 +49,7 @@ public:
|
|||||||
|
|
||||||
std::string getName() const override { return name; }
|
std::string getName() const override { return name; }
|
||||||
|
|
||||||
std::string getTypeName() const override { return "ComplexKey"; }
|
std::string getTypeName() const override { return "ComplexKeyHashed"; }
|
||||||
|
|
||||||
std::size_t getBytesAllocated() const override { return bytes_allocated; }
|
std::size_t getBytesAllocated() const override { return bytes_allocated; }
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ public:
|
|||||||
|
|
||||||
bool isCached() const override { return false; }
|
bool isCached() const override { return false; }
|
||||||
|
|
||||||
DictionaryPtr clone() const override { return std::make_unique<ComplexKeyDictionary>(*this); }
|
DictionaryPtr clone() const override { return std::make_unique<ComplexKeyHashedDictionary>(*this); }
|
||||||
|
|
||||||
const IDictionarySource * getSource() const override { return source_ptr.get(); }
|
const IDictionarySource * getSource() const override { return source_ptr.get(); }
|
||||||
|
|
@ -19,8 +19,8 @@
|
|||||||
#include <DB/Dictionaries/FlatDictionary.h>
|
#include <DB/Dictionaries/FlatDictionary.h>
|
||||||
#include <DB/Dictionaries/HashedDictionary.h>
|
#include <DB/Dictionaries/HashedDictionary.h>
|
||||||
#include <DB/Dictionaries/CacheDictionary.h>
|
#include <DB/Dictionaries/CacheDictionary.h>
|
||||||
|
#include <DB/Dictionaries/ComplexKeyHashedDictionary.h>
|
||||||
#include <DB/Dictionaries/RangeHashedDictionary.h>
|
#include <DB/Dictionaries/RangeHashedDictionary.h>
|
||||||
#include <DB/Dictionaries/ComplexKeyDictionary.h>
|
|
||||||
|
|
||||||
#include <ext/range.hpp>
|
#include <ext/range.hpp>
|
||||||
|
|
||||||
@ -883,7 +883,7 @@ private:
|
|||||||
bool executeDispatchComplex(
|
bool executeDispatchComplex(
|
||||||
Block & block, const ColumnNumbers & arguments, const size_t result, const IDictionaryBase * const dictionary)
|
Block & block, const ColumnNumbers & arguments, const size_t result, const IDictionaryBase * const dictionary)
|
||||||
{
|
{
|
||||||
const auto dict = typeid_cast<const ComplexKeyDictionary *>(dictionary);
|
const auto dict = typeid_cast<const ComplexKeyHashedDictionary *>(dictionary);
|
||||||
if (!dict)
|
if (!dict)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -1425,7 +1425,7 @@ private:
|
|||||||
bool executeDispatchComplex(
|
bool executeDispatchComplex(
|
||||||
Block & block, const ColumnNumbers & arguments, const size_t result, const IDictionaryBase * const dictionary)
|
Block & block, const ColumnNumbers & arguments, const size_t result, const IDictionaryBase * const dictionary)
|
||||||
{
|
{
|
||||||
const auto dict = typeid_cast<const ComplexKeyDictionary *>(dictionary);
|
const auto dict = typeid_cast<const ComplexKeyHashedDictionary *>(dictionary);
|
||||||
if (!dict)
|
if (!dict)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <DB/Dictionaries/HashedDictionary.h>
|
#include <DB/Dictionaries/HashedDictionary.h>
|
||||||
#include <DB/Dictionaries/CacheDictionary.h>
|
#include <DB/Dictionaries/CacheDictionary.h>
|
||||||
#include <DB/Dictionaries/RangeHashedDictionary.h>
|
#include <DB/Dictionaries/RangeHashedDictionary.h>
|
||||||
#include <DB/Dictionaries/ComplexKeyDictionary.h>
|
#include <DB/Dictionaries/ComplexKeyHashedDictionary.h>
|
||||||
#include <DB/Dictionaries/DictionaryStructure.h>
|
#include <DB/Dictionaries/DictionaryStructure.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ DictionaryPtr DictionaryFactory::create(const std::string & name, Poco::Util::Ab
|
|||||||
ErrorCodes::UNSUPPORTED_METHOD
|
ErrorCodes::UNSUPPORTED_METHOD
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!dict_struct.range_min || !dict_struct.range_min)
|
if (!dict_struct.range_min || !dict_struct.range_max)
|
||||||
throw Exception{
|
throw Exception{
|
||||||
name + ": dictionary of layout 'range_hashed' requires .structure.range_min and .structure.range_max",
|
name + ": dictionary of layout 'range_hashed' requires .structure.range_min and .structure.range_max",
|
||||||
ErrorCodes::BAD_ARGUMENTS
|
ErrorCodes::BAD_ARGUMENTS
|
||||||
@ -52,15 +52,15 @@ DictionaryPtr DictionaryFactory::create(const std::string & name, Poco::Util::Ab
|
|||||||
|
|
||||||
return std::make_unique<RangeHashedDictionary>(name, dict_struct, std::move(source_ptr), dict_lifetime, require_nonempty);
|
return std::make_unique<RangeHashedDictionary>(name, dict_struct, std::move(source_ptr), dict_lifetime, require_nonempty);
|
||||||
}
|
}
|
||||||
else if ("complex_key" == layout_type)
|
else if ("complex_key_hashed" == layout_type)
|
||||||
{
|
{
|
||||||
if (!dict_struct.key)
|
if (!dict_struct.key)
|
||||||
throw Exception{
|
throw Exception{
|
||||||
"'key' is required for dictionary of layout 'complex_key'",
|
"'key' is required for dictionary of layout 'complex_key_hashed'",
|
||||||
ErrorCodes::BAD_ARGUMENTS
|
ErrorCodes::BAD_ARGUMENTS
|
||||||
};
|
};
|
||||||
|
|
||||||
return std::make_unique<ComplexKeyDictionary>(name, dict_struct, std::move(source_ptr), dict_lifetime, require_nonempty);
|
return std::make_unique<ComplexKeyHashedDictionary>(name, dict_struct, std::move(source_ptr), dict_lifetime, require_nonempty);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -70,7 +70,7 @@ DictionaryPtr DictionaryFactory::create(const std::string & name, Poco::Util::Ab
|
|||||||
ErrorCodes::UNSUPPORTED_METHOD
|
ErrorCodes::UNSUPPORTED_METHOD
|
||||||
};
|
};
|
||||||
|
|
||||||
if (dict_struct.range_min || dict_struct.range_min)
|
if (dict_struct.range_min || dict_struct.range_max)
|
||||||
throw Exception{
|
throw Exception{
|
||||||
name + ": elements .structure.range_min and .structure.range_max should be defined only "
|
name + ": elements .structure.range_min and .structure.range_max should be defined only "
|
||||||
"for a dictionary of layout 'range_hashed'",
|
"for a dictionary of layout 'range_hashed'",
|
||||||
|
Loading…
Reference in New Issue
Block a user