This commit is contained in:
Vladimir Chebotarev 2021-04-14 11:00:17 +03:00
parent 441958f590
commit a6e246b9ba
3 changed files with 8 additions and 0 deletions

View File

@ -25,6 +25,11 @@ void ASTInsertQuery::formatImpl(const FormatSettings & settings, FormatState & s
{ {
settings.ostr << (settings.hilite ? hilite_keyword : "") << "FUNCTION "; settings.ostr << (settings.hilite ? hilite_keyword : "") << "FUNCTION ";
table_function->formatImpl(settings, state, frame); table_function->formatImpl(settings, state, frame);
if (partition_by)
{
settings.ostr << " PARTITION BY ";
partition_by->formatImpl(settings, state, frame);
}
} }
else else
settings.ostr << (settings.hilite ? hilite_none : "") settings.ostr << (settings.hilite ? hilite_none : "")

View File

@ -20,6 +20,7 @@ public:
ASTPtr infile; ASTPtr infile;
ASTPtr watch; ASTPtr watch;
ASTPtr table_function; ASTPtr table_function;
ASTPtr partition_by;
ASTPtr settings_ast; ASTPtr settings_ast;
/// Data to insert /// Data to insert
@ -44,6 +45,7 @@ public:
if (select) { res->select = select->clone(); res->children.push_back(res->select); } if (select) { res->select = select->clone(); res->children.push_back(res->select); }
if (watch) { res->watch = watch->clone(); res->children.push_back(res->watch); } if (watch) { res->watch = watch->clone(); res->children.push_back(res->watch); }
if (table_function) { res->table_function = table_function->clone(); res->children.push_back(res->table_function); } if (table_function) { res->table_function = table_function->clone(); res->children.push_back(res->table_function); }
if (partition_by) { res->partition_by = partition_by->clone(); res->children.push_back(res->partition_by); }
if (settings_ast) { res->settings_ast = settings_ast->clone(); res->children.push_back(res->settings_ast); } if (settings_ast) { res->settings_ast = settings_ast->clone(); res->children.push_back(res->settings_ast); }
return res; return res;

View File

@ -193,6 +193,7 @@ bool ParserInsertQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
if (table_function) if (table_function)
{ {
query->table_function = table_function; query->table_function = table_function;
query->partition_by = partition_by_expr;
} }
else else
{ {