mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
Let the command SYSTEM RELOAD DICTIONARY to use ON CLUSTER syntax
This commit is contained in:
parent
d5b4b40b4e
commit
9e808e4a0d
@ -12,6 +12,7 @@
|
||||
#include <Interpreters/InterpreterDropQuery.h>
|
||||
#include <Interpreters/InterpreterCreateQuery.h>
|
||||
#include <Interpreters/QueryLog.h>
|
||||
#include <Interpreters/DDLWorker.h>
|
||||
#include <Interpreters/PartLog.h>
|
||||
#include <Interpreters/QueryThreadLog.h>
|
||||
#include <Interpreters/TraceLog.h>
|
||||
@ -130,6 +131,9 @@ BlockIO InterpreterSystemQuery::execute()
|
||||
{
|
||||
auto & query = query_ptr->as<ASTSystemQuery &>();
|
||||
|
||||
if (!query.cluster.empty())
|
||||
return executeDDLQueryOnCluster(query_ptr, context, {query.database});
|
||||
|
||||
using Type = ASTSystemQuery::Type;
|
||||
|
||||
/// Use global context with fresh system profile settings
|
||||
|
@ -108,8 +108,7 @@ void ASTSystemQuery::formatImpl(const FormatSettings & settings, FormatState &,
|
||||
};
|
||||
|
||||
if (!cluster.empty())
|
||||
{
|
||||
}
|
||||
formatOnCluster(settings);
|
||||
if ( type == Type::STOP_MERGES
|
||||
|| type == Type::START_MERGES
|
||||
|| type == Type::STOP_TTL_MERGES
|
||||
@ -133,7 +132,9 @@ void ASTSystemQuery::formatImpl(const FormatSettings & settings, FormatState &,
|
||||
print_database_table();
|
||||
}
|
||||
else if (type == Type::RELOAD_DICTIONARY)
|
||||
{
|
||||
settings.ostr << " " << backQuoteIfNeed(target_dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,14 +38,17 @@ bool ParserSystemQuery::parseImpl(IParser::Pos & pos, ASTPtr & node, Expected &
|
||||
if (!found)
|
||||
return false;
|
||||
|
||||
|
||||
String cluster_str;
|
||||
switch (res->type)
|
||||
{
|
||||
case Type::RELOAD_DICTIONARY:
|
||||
if (ParserKeyword{"ON"}.ignore(pos, expected))
|
||||
{
|
||||
if (!ASTQueryWithOnCluster::parse(pos, res->cluster, expected))
|
||||
if (!ASTQueryWithOnCluster::parse(pos, cluster_str, expected))
|
||||
return false;
|
||||
}
|
||||
res->cluster = cluster_str;
|
||||
if (!parseIdentifierOrStringLiteral(pos, expected, res->target_dictionary))
|
||||
return false;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user