| 1 | #pragma once |
| 2 | |
| 3 | #include <DataTypes/IDataType.h> |
| 4 | |
| 5 | |
| 6 | namespace DB |
| 7 | { |
| 8 | |
| 9 | /** Get data type that covers intersection of all possible values of passed data types. |
| 10 | * DataTypeNothing is the most common subtype for all types. |
| 11 | * Examples: most common subtype for UInt16, UInt8 and Int8 - UInt16. |
| 12 | * Examples: most common subtype for Array(UInt8), Int8 is Nothing |
| 13 | * |
| 14 | * If force_support_conversion is true, returns type which may be used to convert each argument to. |
| 15 | * Example: most common subtype for Array(UInt8) and Array(Nullable(Int32)) is Array(Nullable(UInt8) if force_support_conversion is true. |
| 16 | */ |
| 17 | DataTypePtr getMostSubtype(const DataTypes & types, bool throw_if_result_is_nothing = false, bool force_support_conversion = false); |
| 18 | |
| 19 | } |
| 20 | |