MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / hasTypeThatCanContainNulls

Function hasTypeThatCanContainNulls

src/DataTypes/hasNullable.cpp:34–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34bool 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}

Callers 1

RuntimeFilterBaseMethod · 0.85

Calls 5

getNestedTypeMethod · 0.80
canContainNullFunction · 0.70
getMethod · 0.45
getElementsMethod · 0.45
getKeyTypeMethod · 0.45

Tested by

no test coverage detected