2019-10-31 10:40:11 +00:00
|
|
|
|
2019-10-09 13:02:05 +00:00
|
|
|
#include <Columns/Collator.h>
|
2019-10-16 07:32:37 +00:00
|
|
|
#include <Common/quoteString.h>
|
2019-10-09 13:02:05 +00:00
|
|
|
#include <Parsers/ASTTTLElement.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
void ASTTTLElement::formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const
|
|
|
|
{
|
|
|
|
children.front()->formatImpl(settings, state, frame);
|
2019-11-20 08:06:51 +00:00
|
|
|
if (destination_type == PartDestinationType::DISK)
|
2019-10-16 07:32:37 +00:00
|
|
|
{
|
|
|
|
settings.ostr << " TO DISK " << quoteString(destination_name);
|
2019-10-09 13:02:05 +00:00
|
|
|
}
|
2019-11-20 08:06:51 +00:00
|
|
|
else if (destination_type == PartDestinationType::VOLUME)
|
2019-10-16 07:32:37 +00:00
|
|
|
{
|
|
|
|
settings.ostr << " TO VOLUME " << quoteString(destination_name);
|
|
|
|
}
|
2019-11-20 08:06:51 +00:00
|
|
|
else if (destination_type == PartDestinationType::DELETE)
|
2019-10-16 07:32:37 +00:00
|
|
|
{
|
2019-11-28 06:44:26 +00:00
|
|
|
/// It would be better to output "DELETE" here but that will break compatibility with earlier versions.
|
2019-10-09 13:02:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|