formatting fixes

This commit is contained in:
Alexander Kuzmenkov 2021-03-24 15:36:39 +03:00
parent e0d1f6d80f
commit 02eee100a0
2 changed files with 5 additions and 3 deletions

View File

@ -138,7 +138,7 @@ void ASTSelectQuery::formatImpl(const FormatSettings & s, FormatState & state, F
{
s.ostr << (s.hilite ? hilite_keyword : "") << s.nl_or_ws << indent_str <<
"WINDOW" << (s.hilite ? hilite_none : "");
window()->formatImpl(s, state, frame);
window()->as<ASTExpressionList &>().formatImplMultiline(s, state, frame);
}
if (orderBy())

View File

@ -35,9 +35,11 @@ String ASTWindowDefinition::getID(char) const
void ASTWindowDefinition::formatImpl(const FormatSettings & settings,
FormatState & state, FormatStateStacked format_frame) const
{
format_frame.expression_list_prepend_whitespace = false;
if (partition_by)
{
settings.ostr << "PARTITION BY";
settings.ostr << "PARTITION BY ";
partition_by->formatImpl(settings, state, format_frame);
}
@ -48,7 +50,7 @@ void ASTWindowDefinition::formatImpl(const FormatSettings & settings,
if (order_by)
{
settings.ostr << "ORDER BY";
settings.ostr << "ORDER BY ";
order_by->formatImpl(settings, state, format_frame);
}