1 | #pragma once |
2 | |
3 | #include <Core/Field.h> |
4 | |
5 | |
6 | namespace DB |
7 | { |
8 | |
9 | class IDataType; |
10 | |
11 | /** Used to interpret expressions in a set in IN, |
12 | * and also in the query of the form INSERT ... VALUES ... |
13 | * |
14 | * To work correctly with expressions of the form `1.0 IN (1)` or, for example, `1 IN (1, 2.0, 2.5, -1)` work the same way as `1 IN (1, 2)`. |
15 | * Checks for the compatibility of types, checks values fall in the range of valid values of the type, makes type conversion. |
16 | * If the value does not fall into the range - returns Null. |
17 | */ |
18 | Field convertFieldToType(const Field & from_value, const IDataType & to_type, const IDataType * from_type_hint = nullptr); |
19 | |
20 | } |
21 | |