codestyle fixed

This commit is contained in:
Артем Стрельцов 2020-04-09 23:52:53 +03:00
parent ce01d0aa85
commit cd2eac9f93
5 changed files with 9 additions and 12 deletions

View File

@ -229,7 +229,7 @@ void registerDictionarySourceClickHouse(DictionarySourceFactory & factory)
bool /* check_config */) -> DictionarySourcePtr
{
Context context_local_copy = copyContextAndApplySettings(config_prefix, context, config);
/// Note that processors are not supported yet (see constructor),
/// hence it is not possible to override experimental_use_processors setting
return std::make_unique<ClickHouseDictionarySource>(dict_struct, config, config_prefix + ".clickhouse", sample_block, context_local_copy);

View File

@ -84,11 +84,11 @@ DictionarySourcePtr DictionarySourceFactory::create(
{
Poco::Util::AbstractConfiguration::Keys keys;
config.keys(config_prefix, keys);
if (keys.empty() || keys.size() > 2)
throw Exception{name + ": element dictionary.source should have one or two child elements",
ErrorCodes::EXCESSIVE_ELEMENT_IN_CONFIG};
const auto & source_type = keys.front();
const auto found = registered_sources.find(source_type);

View File

@ -53,12 +53,12 @@ void formatKeys(
}
Context copyContextAndApplySettings(
const std::string & config_prefix,
const Context & context,
const std::string & config_prefix,
const Context & context,
const Poco::Util::AbstractConfiguration & config)
{
Context local_context(context);
if (config.has(config_prefix + ".settings"))
if (config.has(config_prefix + ".settings"))
{
const auto prefix = config_prefix + ".settings";
Settings settings;
@ -66,7 +66,7 @@ Context copyContextAndApplySettings(
settings.loadSettingsFromConfig(prefix, config);
local_context.setSettings(settings);
}
return local_context;
}

View File

@ -14,8 +14,6 @@ using BlockOutputStreamPtr = std::shared_ptr<IBlockOutputStream>;
struct DictionaryStructure;
class Context;
/// Write keys to block output stream.
/// For simple key
@ -30,8 +28,8 @@ void formatKeys(
/// Used for applying settings to copied context in some register[...]Source functions
Context copyContextAndApplySettings(
const std::string & config_prefix,
const Context & context,
const std::string & config_prefix,
const Context & context,
const Poco::Util::AbstractConfiguration & config);
}

View File

@ -15,7 +15,6 @@
#include "DictionarySourceHelpers.h"
#include "DictionaryStructure.h"
#include "registerDictionaries.h"
#include "DictionarySourceHelpers.h"
namespace DB
{