2019-10-09 13:02:05 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/IAST.h>
|
2019-11-20 08:06:51 +00:00
|
|
|
#include <Storages/MergeTree/PartDestinationType.h>
|
2019-10-09 13:02:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
/** Element of TTL expression.
|
|
|
|
*/
|
|
|
|
class ASTTTLElement : public IAST
|
|
|
|
{
|
|
|
|
public:
|
2019-11-20 08:06:51 +00:00
|
|
|
PartDestinationType destination_type;
|
2019-10-09 13:02:05 +00:00
|
|
|
String destination_name;
|
|
|
|
|
2019-11-20 08:06:51 +00:00
|
|
|
ASTTTLElement(PartDestinationType destination_type_, const String & destination_name_)
|
2019-10-09 13:02:05 +00:00
|
|
|
: destination_type(destination_type_)
|
|
|
|
, destination_name(destination_name_)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
String getID(char) const override { return "TTLElement"; }
|
|
|
|
|
|
|
|
ASTPtr clone() const override
|
|
|
|
{
|
|
|
|
auto clone = std::make_shared<ASTTTLElement>(*this);
|
|
|
|
clone->cloneChildren();
|
|
|
|
return clone;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|