Added MATERIALIZE TTL IN PARTITION.

This commit is contained in:
Vladimir Chebotarev 2020-03-10 14:17:26 +03:00
parent f70d00d28d
commit 8a8142049a
3 changed files with 12 additions and 0 deletions

View File

@ -265,6 +265,11 @@ void ASTAlterCommand::formatImpl(
{ {
settings.ostr << (settings.hilite ? hilite_keyword : "") << indent_str << "MATERIALIZE TTL" settings.ostr << (settings.hilite ? hilite_keyword : "") << indent_str << "MATERIALIZE TTL"
<< (settings.hilite ? hilite_none : ""); << (settings.hilite ? hilite_none : "");
if (partition)
{
settings.ostr << (settings.hilite ? hilite_keyword : "") << indent_str<< " IN PARTITION " << (settings.hilite ? hilite_none : "");
partition->formatImpl(settings, state, frame);
}
} }
else if (type == ASTAlterCommand::MODIFY_SETTING) else if (type == ASTAlterCommand::MODIFY_SETTING)
{ {

View File

@ -462,6 +462,12 @@ bool ParserAlterCommand::parseImpl(Pos & pos, ASTPtr & node, Expected & expected
else if (s_materialize_ttl.ignore(pos, expected)) else if (s_materialize_ttl.ignore(pos, expected))
{ {
command->type = ASTAlterCommand::MATERIALIZE_TTL; command->type = ASTAlterCommand::MATERIALIZE_TTL;
if (s_in_partition.ignore(pos, expected))
{
if (!parser_partition.parse(pos, command->partition, expected))
return false;
}
} }
else if (s_modify_setting.ignore(pos, expected)) else if (s_modify_setting.ignore(pos, expected))
{ {

View File

@ -87,6 +87,7 @@ std::optional<MutationCommand> MutationCommand::parse(ASTAlterCommand * command,
MutationCommand res; MutationCommand res;
res.ast = command->ptr(); res.ast = command->ptr();
res.type = MATERIALIZE_TTL; res.type = MATERIALIZE_TTL;
res.partition = command->partition;
return res; return res;
} }
return {}; return {};