2013-05-08 09:52:02 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
2016-01-13 00:32:59 +00:00
|
|
|
|
#include <DB/Core/NamesAndTypes.h>
|
2013-05-08 09:52:02 +00:00
|
|
|
|
#include <DB/Columns/IColumnDummy.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
|
{
|
2014-10-31 22:15:17 +00:00
|
|
|
|
|
2016-01-13 00:32:59 +00:00
|
|
|
|
class ExpressionActions;
|
|
|
|
|
|
2013-05-08 09:52:02 +00:00
|
|
|
|
/** Столбец, содержащий лямбда-выражение.
|
|
|
|
|
* Ведёт себя как столбец-константа. Содержит выражение, но не входные или выходные данные.
|
|
|
|
|
*/
|
2014-06-04 01:00:09 +00:00
|
|
|
|
class ColumnExpression final : public IColumnDummy
|
2013-05-08 09:52:02 +00:00
|
|
|
|
{
|
2016-01-13 00:32:59 +00:00
|
|
|
|
private:
|
|
|
|
|
using ExpressionActionsPtr = std::shared_ptr<ExpressionActions>;
|
2014-10-31 22:15:17 +00:00
|
|
|
|
|
2016-01-13 00:32:59 +00:00
|
|
|
|
public:
|
|
|
|
|
ColumnExpression(size_t s_, ExpressionActionsPtr expression_, const NamesAndTypes & arguments_, DataTypePtr return_type_, String return_name_);
|
|
|
|
|
ColumnExpression(size_t s_, ExpressionActionsPtr expression_, const NamesAndTypesList & arguments_, DataTypePtr return_type_, String return_name_);
|
2014-10-31 22:15:17 +00:00
|
|
|
|
|
2016-01-13 00:32:59 +00:00
|
|
|
|
std::string getName() const override;
|
|
|
|
|
ColumnPtr cloneDummy(size_t s_) const override;
|
2014-10-31 22:15:17 +00:00
|
|
|
|
|
2016-01-13 00:32:59 +00:00
|
|
|
|
const ExpressionActionsPtr & getExpression() const;
|
|
|
|
|
const DataTypePtr & getReturnType() const;
|
|
|
|
|
const std::string & getReturnName() const;
|
|
|
|
|
const NamesAndTypes & getArguments() const;
|
|
|
|
|
Names getArgumentNames() const;
|
2014-10-31 22:15:17 +00:00
|
|
|
|
|
2013-05-08 09:52:02 +00:00
|
|
|
|
private:
|
2013-05-27 14:02:55 +00:00
|
|
|
|
ExpressionActionsPtr expression;
|
2013-05-08 09:52:02 +00:00
|
|
|
|
NamesAndTypes arguments;
|
|
|
|
|
DataTypePtr return_type;
|
2013-05-20 15:42:57 +00:00
|
|
|
|
std::string return_name;
|
2013-05-08 09:52:02 +00:00
|
|
|
|
};
|
2014-10-31 22:15:17 +00:00
|
|
|
|
|
2013-05-08 09:52:02 +00:00
|
|
|
|
}
|