| 32 | } |
| 33 | |
| 34 | bool hasTypeThatCanContainNulls(const DataTypePtr & type) |
| 35 | { |
| 36 | if (canContainNull(*type)) |
| 37 | return true; |
| 38 | |
| 39 | if (const DataTypeArray * type_array = typeid_cast<const DataTypeArray *>(type.get())) |
| 40 | return hasTypeThatCanContainNulls(type_array->getNestedType()); |
| 41 | if (const DataTypeTuple * type_tuple = typeid_cast<const DataTypeTuple *>(type.get())) |
| 42 | { |
| 43 | for (const auto & subtype : type_tuple->getElements()) |
| 44 | { |
| 45 | if (hasTypeThatCanContainNulls(subtype)) |
| 46 | return true; |
| 47 | } |
| 48 | return false; |
| 49 | } |
| 50 | if (const DataTypeMap * type_map = typeid_cast<const DataTypeMap *>(type.get())) |
| 51 | return hasTypeThatCanContainNulls(type_map->getKeyType()) || hasTypeThatCanContainNulls(type_map->getValueType()); |
| 52 | return false; |
| 53 | } |
| 54 | |
| 55 | } |
no test coverage detected