mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
dbms: uncomment clickhouse dictionary source creation [#METR-13298]
This commit is contained in:
parent
cee209db3e
commit
ad54825dfe
@ -60,8 +60,8 @@ public:
|
||||
}
|
||||
else if (config.has(config_prefix + "clickhouse"))
|
||||
{
|
||||
return nullptr;//ext::make_unique<ClickhouseDictionarySource>(config, config_prefix + "clickhouse.",
|
||||
//sample_block, context);
|
||||
ext::make_unique<ClickhouseDictionarySource>(config, config_prefix + "clickhouse.",
|
||||
sample_block, context);
|
||||
}
|
||||
|
||||
throw Exception{"unsupported source type"};
|
||||
|
@ -7,11 +7,30 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace
|
||||
{
|
||||
std::string getDictionariesConfigPath(const Poco::Util::AbstractConfiguration & config)
|
||||
{
|
||||
const auto path = config.getString("dictionaries_config");
|
||||
if (path.empty())
|
||||
return path;
|
||||
|
||||
if (path[0] != '/')
|
||||
{
|
||||
const auto app_config_path = config.getString("config-file", "config.xml");
|
||||
const auto config_dir = Poco::Path{app_config_path}.parent().toString();
|
||||
const auto absolute_path = config_dir + path;
|
||||
if (Poco::File{absolute_path}.exists())
|
||||
return absolute_path;
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
void Dictionaries::reloadExternals()
|
||||
{
|
||||
const auto config_path = Poco::Util::Application::instance().config().getString("dictionaries_config");
|
||||
if (config_path.empty())
|
||||
return;
|
||||
const auto config_path = getDictionariesConfigPath(Poco::Util::Application::instance().config());
|
||||
|
||||
const auto last_modified = Poco::File{config_path}.getLastModified();
|
||||
if (last_modified > dictionaries_last_modified)
|
||||
|
Loading…
Reference in New Issue
Block a user