ClickHouse/dbms/src/Columns/ColumnExpression.cpp

44 lines
1.5 KiB
C++
Raw Normal View History

#include <Interpreters/ExpressionActions.h>
#include <Columns/ColumnExpression.h>
2016-01-13 00:32:59 +00:00
namespace DB
{
ColumnExpression::ColumnExpression(
size_t s_, ExpressionActionsPtr expression_, const NamesAndTypes & arguments_, DataTypePtr return_type_, std::string return_name_)
: IColumnDummy(s_), expression(expression_), arguments(arguments_), return_type(return_type_), return_name(return_name_)
2016-01-13 00:32:59 +00:00
{
}
ColumnExpression::ColumnExpression(
size_t s_, ExpressionActionsPtr expression_, const NamesAndTypesList & arguments_, DataTypePtr return_type_, std::string return_name_)
: IColumnDummy(s_), expression(expression_), arguments(arguments_.begin(), arguments_.end()), return_type(return_type_), return_name(return_name_)
2016-01-13 00:32:59 +00:00
{
}
std::string ColumnExpression::getName() const
{
return "ColumnExpression";
2016-01-13 00:32:59 +00:00
}
ColumnPtr ColumnExpression::cloneDummy(size_t s_) const
{
return std::make_shared<ColumnExpression>(s_, expression, arguments, return_type, return_name);
2016-01-13 00:32:59 +00:00
}
const ExpressionActionsPtr & ColumnExpression::getExpression() const { return expression; }
const DataTypePtr & ColumnExpression::getReturnType() const { return return_type; }
const std::string & ColumnExpression::getReturnName() const { return return_name; }
const NamesAndTypes & ColumnExpression::getArguments() const { return arguments; }
Names ColumnExpression::getArgumentNames() const
{
Names res(arguments.size());
for (size_t i = 0; i < arguments.size(); ++i)
res[i] = arguments[i].name;
return res;
2016-01-13 00:32:59 +00:00
}
}