2016-01-13 00:32:59 +00:00
|
|
|
#include <DB/Interpreters/ExpressionActions.h>
|
|
|
|
#include <DB/Columns/ColumnExpression.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
ColumnExpression::ColumnExpression(
|
2017-04-01 07:20:54 +00:00
|
|
|
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(
|
2017-04-01 07:20:54 +00:00
|
|
|
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
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
return "ColumnExpression";
|
2016-01-13 00:32:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ColumnPtr ColumnExpression::cloneDummy(size_t s_) const
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
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
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
}
|