ClickHouse/src/Parsers/ASTDictionaryAttributeDeclaration.h
Azat Khuzhin b680697cce Initialize POD members of ASTs to make it less error-prone
The cost of initializing members is insignificant in compare to parsing,
while the cost of the error is high.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-25 10:18:55 +02:00

37 lines
999 B
C++

#pragma once
#include <Parsers/IAST.h>
#include <Parsers/ASTExpressionList.h>
namespace DB
{
/// AST for single dictionary attribute in dictionary DDL query
class ASTDictionaryAttributeDeclaration : public IAST
{
public:
/// Attribute name
String name;
/// Attribute type
ASTPtr type;
/// Attribute default value
ASTPtr default_value;
/// Attribute expression
ASTPtr expression;
/// Is attribute mirrored to the parent identifier
bool hierarchical = false;
/// Is hierarchical attribute bidirectional
bool bidirectional = false;
/// Flag that shows whether the id->attribute image is injective
bool injective = false;
/// MongoDB object ID
bool is_object_id = false;
String getID(char delim) const override { return "DictionaryAttributeDeclaration" + (delim + name); }
ASTPtr clone() const override;
void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override;
};
}