ClickHouse/dbms/include/DB/Functions/FunctionsNull.h

86 lines
2.6 KiB
C++
Raw Normal View History

#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>
namespace DB
{
2016-08-04 23:32:18 +00:00
class Block;
class Context;
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-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;
};
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;
};
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-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-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;
};
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;
};
}