ClickHouse/src/Parsers/ASTPartition.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
790 B
C++
Raw Normal View History

#pragma once
#include <Parsers/IAST.h>
#include <optional>
namespace DB
{
/// Either a (possibly compound) expression representing a partition value or a partition ID.
class ASTPartition : public IAST
{
public:
2023-10-13 14:22:18 +00:00
IAST * value{nullptr};
2023-10-13 14:52:04 +00:00
size_t fields_count;
2023-10-13 14:22:18 +00:00
IAST * id{nullptr};
bool all = false;
String getID(char) const override;
ASTPtr clone() const override;
2023-10-13 14:22:18 +00:00
void setPartitionID(const ASTPtr & ast);
void setPartitionValue(const ASTPtr & ast);
void forEachPointerToChild(std::function<void(void **)> f) override
{
f(reinterpret_cast<void **>(&value));
f(reinterpret_cast<void **>(&id));
}
protected:
void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override;
};
}