ClickHouse/dbms/include/DB/Functions/Conditional/ArgsInfo.h

42 lines
1.3 KiB
C++
Raw Normal View History

2016-04-18 14:31:32 +00:00
#pragma once
#include <DB/DataTypes/IDataType.h>
namespace DB
{
namespace Conditional
{
/// Determine the return type of the function multiIf when all the
/// branches (then, else) have numeric types.
DataTypePtr getReturnTypeForArithmeticArgs(const DataTypes & args);
2016-08-15 14:36:01 +00:00
/// Returns true if either all the branches are null or
/// all the non-null branches (then, else) have numeric types.
2016-04-18 14:31:32 +00:00
bool hasArithmeticBranches(const DataTypes & args);
2016-08-15 14:36:01 +00:00
/// Returns true if either all the branches are null or
/// all the non-null branches (then, else) are arrays.
2016-04-18 14:31:32 +00:00
bool hasArrayBranches(const DataTypes & args);
2016-08-15 14:36:01 +00:00
/// Returns true if either all the branches are null or
/// all the non-null branches (then, else) have the same type name.
2016-04-18 14:31:32 +00:00
bool hasIdenticalTypes(const DataTypes & args);
2016-08-15 14:36:01 +00:00
/// Returns true if either all the branches are null or
/// all the non-null branches (then, else) are fixed strings.
2016-04-18 14:31:32 +00:00
bool hasFixedStrings(const DataTypes & args);
2016-08-15 14:36:01 +00:00
/// Returns true if either all the branches are null or
/// all the non-null branches (then, else) are fixed strings of equal length.
2016-04-18 14:31:32 +00:00
bool hasFixedStringsOfIdenticalLength(const DataTypes & args);
2016-08-15 14:36:01 +00:00
/// Returns true if either all the branches are null or
/// all the non-null branches (then, else) are strings.
2016-04-18 14:31:32 +00:00
bool hasStrings(const DataTypes & args);
}
}