mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
allow positional options for clickhouse-local and populate global udf settings
This commit is contained in:
parent
7bcef0a6c0
commit
d35c87c1bd
@ -266,6 +266,10 @@ void LocalServer::tryInitPath()
|
||||
|
||||
global_context->setUserFilesPath(""); // user's files are everywhere
|
||||
|
||||
std::string user_scripts_path = config().getString("user_scripts_path", fs::path(path) / "user_scripts/");
|
||||
global_context->setUserScriptsPath(user_scripts_path);
|
||||
fs::create_directories(user_scripts_path);
|
||||
|
||||
/// top_level_domains_lists
|
||||
const std::string & top_level_domains_path = config().getString("top_level_domains_path", path + "top_level_domains/");
|
||||
if (!top_level_domains_path.empty())
|
||||
@ -490,6 +494,17 @@ try
|
||||
|
||||
applyCmdSettings(global_context);
|
||||
|
||||
/// try to load user defined executable functions, throw on error and die
|
||||
try
|
||||
{
|
||||
global_context->loadOrReloadUserDefinedExecutableFunctions(config());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
tryLogCurrentException(&logger(), "Caught exception while loading user defined executable functions.");
|
||||
throw;
|
||||
}
|
||||
|
||||
if (is_interactive)
|
||||
{
|
||||
clearTerminal();
|
||||
|
@ -2624,11 +2624,6 @@ void ClientBase::parseAndCheckOptions(OptionsDescription & options_description,
|
||||
throw Exception(ErrorCodes::UNRECOGNIZED_ARGUMENTS, "Unrecognized option '{}'", unrecognized_options[0]);
|
||||
}
|
||||
|
||||
/// Check positional options (options after ' -- ', ex: clickhouse-client -- <options>).
|
||||
unrecognized_options = po::collect_unrecognized(parsed.options, po::collect_unrecognized_mode::include_positional);
|
||||
if (unrecognized_options.size() > 1)
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Positional options are not supported.");
|
||||
|
||||
po::store(parsed, options);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user