ClickHouse/src/Parsers/ASTAsterisk.cpp

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

47 lines
1.0 KiB
C++
Raw Normal View History

#include <Parsers/ASTAsterisk.h>
#include <IO/WriteBuffer.h>
2020-11-09 16:05:40 +00:00
#include <IO/Operators.h>
namespace DB
{
ASTPtr ASTAsterisk::clone() const
{
auto clone = std::make_shared<ASTAsterisk>(*this);
2023-02-19 23:26:14 +00:00
clone->children.clear();
if (expression) { clone->expression = expression->clone(); clone->children.push_back(clone->expression); }
2022-11-30 02:14:04 +00:00
if (transformers) { clone->transformers = transformers->clone(); clone->children.push_back(clone->transformers); }
return clone;
}
2022-11-30 02:14:04 +00:00
void ASTAsterisk::appendColumnName(WriteBuffer & ostr) const
{
if (expression)
{
expression->appendColumnName(ostr);
writeCString(".", ostr);
}
ostr.write('*');
}
2020-08-29 05:33:46 +00:00
void ASTAsterisk::formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const
{
if (expression)
{
expression->formatImpl(settings, state, frame);
settings.ostr << ".";
}
settings.ostr << "*";
2022-11-30 02:14:04 +00:00
if (transformers)
2020-08-29 05:33:46 +00:00
{
2022-11-30 02:14:04 +00:00
transformers->formatImpl(settings, state, frame);
2020-08-29 05:33:46 +00:00
}
}
}