2018-01-11 18:37:11 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DataTypes/IDataType.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/** Get data type that covers intersection of all possible values of passed data types.
|
|
|
|
* DataTypeNothing is the most common subtype for all types.
|
2018-01-19 19:08:39 +00:00
|
|
|
* Examples: most common subtype for UInt16, UInt8 and Int8 - UInt16.
|
2018-01-11 18:37:11 +00:00
|
|
|
* Examples: most common subtype for Array(UInt8), Int8 is Nothing
|
2018-01-12 14:57:04 +00:00
|
|
|
*
|
|
|
|
* If force_support_conversion is true, returns type which may be used to convert each argument to.
|
|
|
|
* Example: most common subtype for Array(UInt8) and Array(Nullable(Int32)) is Array(Nullable(UInt8) if force_support_conversion is true.
|
2018-01-11 18:37:11 +00:00
|
|
|
*/
|
2018-01-12 14:57:04 +00:00
|
|
|
DataTypePtr getMostSubtype(const DataTypes & types, bool throw_if_result_is_nothing = false, bool force_support_conversion = false);
|
2018-01-11 18:37:11 +00:00
|
|
|
|
|
|
|
}
|