mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
dbms: tiny improvement [#CONV-2944].
This commit is contained in:
parent
45f88eb1d1
commit
cfb884f853
@ -3,6 +3,7 @@
|
||||
#include <DB/Parsers/IAST.h>
|
||||
#include <DB/Functions/IFunction.h>
|
||||
#include <DB/AggregateFunctions/IAggregateFunction.h>
|
||||
#include <DB/IO/WriteBufferFromString.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
@ -36,31 +37,32 @@ public:
|
||||
|
||||
String getColumnName() const
|
||||
{
|
||||
std::stringstream s;
|
||||
s << name;
|
||||
String res;
|
||||
WriteBufferFromString wb(res);
|
||||
writeString(name, wb);
|
||||
|
||||
if (parameters)
|
||||
{
|
||||
s << "(";
|
||||
writeChar('(', wb);
|
||||
for (ASTs::const_iterator it = parameters->children.begin(); it != parameters->children.end(); ++it)
|
||||
{
|
||||
if (it != parameters->children.begin())
|
||||
s << ", ";
|
||||
s << (*it)->getColumnName();
|
||||
writeString(", ", wb);
|
||||
writeString((*it)->getColumnName(), wb);
|
||||
}
|
||||
s << ")";
|
||||
writeChar(')', wb);
|
||||
}
|
||||
|
||||
s << "(";
|
||||
writeChar('(', wb);
|
||||
for (ASTs::const_iterator it = arguments->children.begin(); it != arguments->children.end(); ++it)
|
||||
{
|
||||
if (it != arguments->children.begin())
|
||||
s << ", ";
|
||||
s << (*it)->getColumnName();
|
||||
writeString(", ", wb);
|
||||
writeString((*it)->getColumnName(), wb);
|
||||
}
|
||||
s << ")";
|
||||
writeChar(')', wb);
|
||||
|
||||
return s.str();
|
||||
return res;
|
||||
}
|
||||
|
||||
String getAlias() const { return alias.empty() ? getColumnName() : alias; }
|
||||
|
Loading…
Reference in New Issue
Block a user