2018-02-06 19:34:53 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DataTypes/IDataTypeDummy.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/** Special data type, representing lambda expression.
|
|
|
|
*/
|
|
|
|
class DataTypeFunction final : public IDataTypeDummy
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
DataTypes argument_types;
|
|
|
|
DataTypePtr return_type;
|
|
|
|
|
|
|
|
public:
|
|
|
|
static constexpr bool is_parametric = true;
|
|
|
|
bool isParametric() const override { return true; }
|
|
|
|
|
|
|
|
/// Some types could be still unknown.
|
2022-03-12 17:46:38 +00:00
|
|
|
explicit DataTypeFunction(const DataTypes & argument_types_ = DataTypes(), const DataTypePtr & return_type_ = nullptr)
|
2018-02-06 19:34:53 +00:00
|
|
|
: argument_types(argument_types_), return_type(return_type_) {}
|
|
|
|
|
2018-12-13 13:41:47 +00:00
|
|
|
std::string doGetName() const override;
|
2018-02-06 19:34:53 +00:00
|
|
|
const char * getFamilyName() const override { return "Function"; }
|
2018-09-07 14:37:26 +00:00
|
|
|
TypeIndex getTypeId() const override { return TypeIndex::Function; }
|
2018-02-06 19:34:53 +00:00
|
|
|
|
|
|
|
const DataTypes & getArgumentTypes() const
|
|
|
|
{
|
|
|
|
return argument_types;
|
|
|
|
}
|
|
|
|
|
|
|
|
const DataTypePtr & getReturnType() const
|
|
|
|
{
|
|
|
|
return return_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool equals(const IDataType & rhs) const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|