mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 21:42:39 +00:00
bdada351c8
This reverts commit583b9637c2
, reversing changes made to224e937620
.
38 lines
1.3 KiB
C++
38 lines
1.3 KiB
C++
#include <Parsers/ASTOptimizeQuery.h>
|
|
#include <Common/quoteString.h>
|
|
#include <IO/Operators.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
void ASTOptimizeQuery::formatQueryImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const
|
|
{
|
|
settings.ostr << (settings.hilite ? hilite_keyword : "") << "OPTIMIZE TABLE " << (settings.hilite ? hilite_none : "")
|
|
<< (database ? backQuoteIfNeed(getDatabase()) + "." : "") << backQuoteIfNeed(getTable());
|
|
|
|
formatOnCluster(settings);
|
|
|
|
if (partition)
|
|
{
|
|
settings.ostr << (settings.hilite ? hilite_keyword : "") << " PARTITION " << (settings.hilite ? hilite_none : "");
|
|
partition->formatImpl(settings, state, frame);
|
|
}
|
|
|
|
if (final)
|
|
settings.ostr << (settings.hilite ? hilite_keyword : "") << " FINAL" << (settings.hilite ? hilite_none : "");
|
|
|
|
if (deduplicate)
|
|
settings.ostr << (settings.hilite ? hilite_keyword : "") << " DEDUPLICATE" << (settings.hilite ? hilite_none : "");
|
|
|
|
if (cleanup)
|
|
settings.ostr << (settings.hilite ? hilite_keyword : "") << " CLEANUP" << (settings.hilite ? hilite_none : "");
|
|
|
|
if (deduplicate_by_columns)
|
|
{
|
|
settings.ostr << (settings.hilite ? hilite_keyword : "") << " BY " << (settings.hilite ? hilite_none : "");
|
|
deduplicate_by_columns->formatImpl(settings, state, frame);
|
|
}
|
|
}
|
|
|
|
}
|