#pragma once #include #include namespace DB { /// Either a (possibly compound) expression representing a partition value or a partition ID. class ASTPartition : public IAST { public: IAST * value{nullptr}; std::optional fields_count; IAST * id{nullptr}; bool all = false; String getID(char) const override; ASTPtr clone() const override; void setPartitionID(const ASTPtr & ast); void setPartitionValue(const ASTPtr & ast); void forEachPointerToChild(std::function f) override { f(reinterpret_cast(&value)); f(reinterpret_cast(&id)); } protected: void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override; }; }