mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
31 lines
799 B
C++
31 lines
799 B
C++
#pragma once
|
|
|
|
#include <DB/Parsers/IAST.h>
|
|
#include <DB/Core/Types.h>
|
|
#include <mysqlxx/Manip.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class ASTWeightedZooKeeperPath : public IAST
|
|
{
|
|
public:
|
|
ASTWeightedZooKeeperPath() = default;
|
|
ASTWeightedZooKeeperPath(StringRange range_) : IAST(range_) {}
|
|
String getID() const override { return "Weighted_ZooKeeper_Path"; }
|
|
ASTPtr clone() const override { return std::make_shared<ASTWeightedZooKeeperPath>(*this); }
|
|
|
|
public:
|
|
String path;
|
|
UInt64 weight;
|
|
|
|
protected:
|
|
void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override
|
|
{
|
|
std::string indent_str = settings.one_line ? "" : std::string(4 * frame.indent, ' ');
|
|
settings.ostr << settings.nl_or_ws << indent_str << mysqlxx::quote << path << " WEIGHT " << weight;
|
|
}
|
|
};
|
|
|
|
}
|