forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataTypeFunction.cpp
More file actions
36 lines (30 loc) · 807 Bytes
/
Copy pathDataTypeFunction.cpp
File metadata and controls
36 lines (30 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <DataTypes/DataTypeFunction.h>
#include <IO/WriteBufferFromString.h>
#include <IO/Operators.h>
namespace DB
{
std::string DataTypeFunction::doGetName() const
{
WriteBufferFromOwnString res;
res << "Function(";
if (argument_types.size() > 1)
res << "(";
for (size_t i = 0; i < argument_types.size(); ++i)
{
if (i > 0)
res << ", ";
const DataTypePtr & type = argument_types[i];
res << (type ? type->getName() : "?");
}
if (argument_types.size() > 1)
res << ")";
res << " -> ";
res << (return_type ? return_type->getName() : "?");
res << ")";
return res.str();
}
bool DataTypeFunction::equals(const IDataType & rhs) const
{
return typeid(rhs) == typeid(*this) && getName() == rhs.getName();
}
}