2016-07-06 09:47:55 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DB/Functions/IFunction.h>
|
2016-08-04 23:32:18 +00:00
|
|
|
#include <DB/DataTypes/IDataType.h>
|
|
|
|
#include <DB/Core/ColumnNumbers.h>
|
2016-07-06 09:47:55 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2016-08-04 23:32:18 +00:00
|
|
|
class Block;
|
|
|
|
class Context;
|
|
|
|
|
2016-07-06 09:47:55 +00:00
|
|
|
class FunctionIsNull : public IFunction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr auto name = "isNull";
|
2016-08-04 23:32:18 +00:00
|
|
|
static FunctionPtr create(const Context & context);
|
2016-07-06 09:47:55 +00:00
|
|
|
|
2016-08-04 23:32:18 +00:00
|
|
|
std::string getName() const override;
|
|
|
|
bool hasSpecialSupportForNulls() const override;
|
|
|
|
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override;
|
|
|
|
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result) override;
|
2016-07-06 09:47:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class FunctionIsNotNull : public IFunction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr auto name = "isNotNull";
|
2016-08-04 23:32:18 +00:00
|
|
|
static FunctionPtr create(const Context & context);
|
2016-07-12 14:58:54 +00:00
|
|
|
|
2016-08-04 23:32:18 +00:00
|
|
|
std::string getName() const override;
|
|
|
|
bool hasSpecialSupportForNulls() const override;
|
|
|
|
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override;
|
|
|
|
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result) override;
|
2016-07-25 18:26:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class FunctionCoalesce : public IFunction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr auto name = "coalesce";
|
2016-08-04 23:32:18 +00:00
|
|
|
static FunctionPtr create(const Context & context);
|
2016-07-25 18:26:45 +00:00
|
|
|
|
2016-08-04 23:32:18 +00:00
|
|
|
std::string getName() const override;
|
|
|
|
bool hasSpecialSupportForNulls() const override;
|
|
|
|
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override;
|
|
|
|
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result) override;
|
2016-07-06 09:47:55 +00:00
|
|
|
};
|
|
|
|
|
2016-08-05 12:30:56 +00:00
|
|
|
class FunctionIfNull : public IFunction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr auto name = "ifNull";
|
|
|
|
static FunctionPtr create(const Context & context);
|
|
|
|
|
|
|
|
std::string getName() const override;
|
|
|
|
bool hasSpecialSupportForNulls() const override;
|
|
|
|
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override;
|
|
|
|
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class FunctionNullIf : public IFunction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr auto name = "nullIf";
|
|
|
|
static FunctionPtr create(const Context & context);
|
|
|
|
|
|
|
|
std::string getName() const override;
|
|
|
|
bool hasSpecialSupportForNulls() const override;
|
|
|
|
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override;
|
|
|
|
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result) override;
|
|
|
|
};
|
|
|
|
|
2016-08-05 12:52:09 +00:00
|
|
|
class FunctionAssumeNotNull : public IFunction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr auto name = "assumeNotNull";
|
|
|
|
static FunctionPtr create(const Context & context);
|
|
|
|
|
|
|
|
std::string getName() const override;
|
|
|
|
bool hasSpecialSupportForNulls() const override;
|
|
|
|
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override;
|
|
|
|
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result) override;
|
|
|
|
};
|
|
|
|
|
2016-07-06 09:47:55 +00:00
|
|
|
}
|