Skip to content

Commit d10a731

Browse files
committed
pass dict name to source
1 parent 7e08bf7 commit d10a731

18 files changed

+33
-18
lines changed

src/Dictionaries/CassandraDictionarySource.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ namespace ErrorCodes
1818

1919
void registerDictionarySourceCassandra(DictionarySourceFactory & factory)
2020
{
21-
auto create_table_source = [=]([[maybe_unused]] const DictionaryStructure & dict_struct,
21+
auto create_table_source = [=]([[maybe_unused]] const String & name,
22+
[[maybe_unused]] const DictionaryStructure & dict_struct,
2223
[[maybe_unused]] const Poco::Util::AbstractConfiguration & config,
2324
[[maybe_unused]] const std::string & config_prefix,
2425
[[maybe_unused]] Block & sample_block,

src/Dictionaries/ClickHouseDictionarySource.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ std::string ClickHouseDictionarySource::doInvalidateQuery(const std::string & re
215215

216216
void registerDictionarySourceClickHouse(DictionarySourceFactory & factory)
217217
{
218-
auto create_table_source = [=](const DictionaryStructure & dict_struct,
218+
auto create_table_source = [=](const String & /*name*/,
219+
const DictionaryStructure & dict_struct,
219220
const Poco::Util::AbstractConfiguration & config,
220221
const std::string & config_prefix,
221222
Block & sample_block,

src/Dictionaries/DictionarySourceFactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ DictionarySourcePtr DictionarySourceFactory::create(
9999
{
100100
const auto & create_source = found->second;
101101
auto sample_block = createSampleBlock(dict_struct);
102-
return create_source(dict_struct, config, config_prefix, sample_block, global_context, default_database, check_config);
102+
return create_source(name, dict_struct, config, config_prefix, sample_block, global_context, default_database, check_config);
103103
}
104104

105105
throw Exception(ErrorCodes::UNKNOWN_ELEMENT_IN_CONFIG,

src/Dictionaries/DictionarySourceFactory.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class DictionarySourceFactory : private boost::noncopyable
3232
/// It is used as default_database for ClickHouse dictionary source when no explicit database was specified.
3333
/// Does not make sense for other sources.
3434
using Creator = std::function<DictionarySourcePtr(
35+
const String & name,
3536
const DictionaryStructure & dict_struct,
3637
const Poco::Util::AbstractConfiguration & config,
3738
const std::string & config_prefix,

src/Dictionaries/ExecutableDictionarySource.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ std::string ExecutableDictionarySource::toString() const
215215

216216
void registerDictionarySourceExecutable(DictionarySourceFactory & factory)
217217
{
218-
auto create_table_source = [=](const DictionaryStructure & dict_struct,
218+
auto create_table_source = [=](const String & /*name*/,
219+
const DictionaryStructure & dict_struct,
219220
const Poco::Util::AbstractConfiguration & config,
220221
const std::string & config_prefix,
221222
Block & sample_block,

src/Dictionaries/ExecutablePoolDictionarySource.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ std::string ExecutablePoolDictionarySource::toString() const
187187

188188
void registerDictionarySourceExecutablePool(DictionarySourceFactory & factory)
189189
{
190-
auto create_table_source = [=](const DictionaryStructure & dict_struct,
190+
auto create_table_source = [=](const String & /*name*/,
191+
const DictionaryStructure & dict_struct,
191192
const Poco::Util::AbstractConfiguration & config,
192193
const std::string & config_prefix,
193194
Block & sample_block,

src/Dictionaries/FileDictionarySource.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ Poco::Timestamp FileDictionarySource::getLastModification() const
7272

7373
void registerDictionarySourceFile(DictionarySourceFactory & factory)
7474
{
75-
auto create_table_source = [=](const DictionaryStructure & dict_struct,
75+
auto create_table_source = [=](const String & /*name*/,
76+
const DictionaryStructure & dict_struct,
7677
const Poco::Util::AbstractConfiguration & config,
7778
const std::string & config_prefix,
7879
Block & sample_block,

src/Dictionaries/HTTPDictionarySource.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ std::string HTTPDictionarySource::toString() const
206206

207207
void registerDictionarySourceHTTP(DictionarySourceFactory & factory)
208208
{
209-
auto create_table_source = [=](const DictionaryStructure & dict_struct,
209+
auto create_table_source = [=](const String & /*name*/,
210+
const DictionaryStructure & dict_struct,
210211
const Poco::Util::AbstractConfiguration & config,
211212
const std::string & config_prefix,
212213
Block & sample_block,

src/Dictionaries/LibraryDictionarySource.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ String LibraryDictionarySource::getDictAttributesString()
176176

177177
void registerDictionarySourceLibrary(DictionarySourceFactory & factory)
178178
{
179-
auto create_table_source = [=](const DictionaryStructure & dict_struct,
179+
auto create_table_source = [=](const String & /*name*/,
180+
const DictionaryStructure & dict_struct,
180181
const Poco::Util::AbstractConfiguration & config,
181182
const std::string & config_prefix,
182183
Block & sample_block,

src/Dictionaries/MongoDBDictionarySource.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace ErrorCodes
3535
void registerDictionarySourceMongoDB(DictionarySourceFactory & factory)
3636
{
3737
#if USE_MONGODB
38-
auto create_dictionary_source = [](
38+
auto create_dictionary_source = [](const String & /*name*/,
3939
const DictionaryStructure & dict_struct,
4040
const Poco::Util::AbstractConfiguration & config,
4141
const std::string & root_config_prefix,

0 commit comments

Comments
 (0)