| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <Parsers/IAST.h> |
| 4 | #include <Storages/MergeTree/PartDestinationType.h> |
| 5 | |
| 6 | |
| 7 | namespace DB |
| 8 | { |
| 9 | /** Element of TTL expression. |
| 10 | */ |
| 11 | class ASTTTLElement : public IAST |
| 12 | { |
| 13 | public: |
| 14 | PartDestinationType destination_type; |
| 15 | String destination_name; |
| 16 | |
| 17 | ASTTTLElement(PartDestinationType destination_type_, const String & destination_name_) |
| 18 | : destination_type(destination_type_) |
| 19 | , destination_name(destination_name_) |
| 20 | { |
| 21 | } |
| 22 | |
| 23 | String getID(char) const override { return "TTLElement"; } |
| 24 | |
| 25 | ASTPtr clone() const override |
| 26 | { |
| 27 | auto clone = std::make_shared<ASTTTLElement>(*this); |
| 28 | clone->cloneChildren(); |
| 29 | return clone; |
| 30 | } |
| 31 | |
| 32 | protected: |
| 33 | void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override; |
| 34 | }; |
| 35 | |
| 36 | } |
| 37 |