mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 04:22:03 +00:00
47 lines
1.0 KiB
C++
47 lines
1.0 KiB
C++
#include <Parsers/ASTAsterisk.h>
|
|
#include <IO/WriteBuffer.h>
|
|
#include <IO/Operators.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
ASTPtr ASTAsterisk::clone() const
|
|
{
|
|
auto clone = std::make_shared<ASTAsterisk>(*this);
|
|
clone->children.clear();
|
|
|
|
if (expression) { clone->expression = expression->clone(); clone->children.push_back(clone->expression); }
|
|
if (transformers) { clone->transformers = transformers->clone(); clone->children.push_back(clone->transformers); }
|
|
|
|
return clone;
|
|
}
|
|
|
|
void ASTAsterisk::appendColumnName(WriteBuffer & ostr) const
|
|
{
|
|
if (expression)
|
|
{
|
|
expression->appendColumnName(ostr);
|
|
writeCString(".", ostr);
|
|
}
|
|
|
|
ostr.write('*');
|
|
}
|
|
|
|
void ASTAsterisk::formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const
|
|
{
|
|
if (expression)
|
|
{
|
|
expression->formatImpl(settings, state, frame);
|
|
settings.ostr << ".";
|
|
}
|
|
|
|
settings.ostr << "*";
|
|
|
|
if (transformers)
|
|
{
|
|
transformers->formatImpl(settings, state, frame);
|
|
}
|
|
}
|
|
|
|
}
|