diff --git a/dbms/src/Parsers/formatAST.cpp b/dbms/src/Parsers/formatAST.cpp index 92b90facb86..bd06c0c08fd 100644 --- a/dbms/src/Parsers/formatAST.cpp +++ b/dbms/src/Parsers/formatAST.cpp @@ -152,6 +152,17 @@ void formatAST(const ASTSelectQuery & ast, std::ostream & s, size_t indent, bo formatAST(*ast.table, s, indent, hilite, one_line); } + if (ast.final) + { + s << (hilite ? hilite_keyword : "") << nl_or_ws << indent_str << "FINAL" << (hilite ? hilite_none : ""); + } + + if (ast.sample_size) + { + s << (hilite ? hilite_keyword : "") << nl_or_ws << indent_str << "SAMPLE " << (hilite ? hilite_none : ""); + formatAST(*ast.sample_size, s, indent, hilite, one_line); + } + if (ast.array_join_expression_list) { s << (hilite ? hilite_keyword : "") << nl_or_ws << indent_str << "ARRAY JOIN " << (hilite ? hilite_none : ""); @@ -166,17 +177,6 @@ void formatAST(const ASTSelectQuery & ast, std::ostream & s, size_t indent, bo formatAST(*ast.join, s, indent, hilite, one_line); } - if (ast.final) - { - s << (hilite ? hilite_keyword : "") << nl_or_ws << indent_str << "FINAL" << (hilite ? hilite_none : ""); - } - - if (ast.sample_size) - { - s << (hilite ? hilite_keyword : "") << nl_or_ws << indent_str << "SAMPLE " << (hilite ? hilite_none : ""); - formatAST(*ast.sample_size, s, indent, hilite, one_line); - } - if (ast.prewhere_expression) { s << (hilite ? hilite_keyword : "") << nl_or_ws << indent_str << "PREWHERE " << (hilite ? hilite_none : "");