MCPcopy Create free account
hub / github.com/ByConity/ByConity / convertTypeToNullable

Function convertTypeToNullable

src/Interpreters/join_common.cpp:88–104  ·  view source on GitHub ↗

Add nullability to type. Note: LowCardinality(T) transformed to LowCardinality(Nullable(T))

Source from the content-addressed store, hash-verified

86/// Add nullability to type.
87/// Note: LowCardinality(T) transformed to LowCardinality(Nullable(T))
88DataTypePtr convertTypeToNullable(const DataTypePtr & type)
89{
90 if (isNullable(type))
91 return type;
92
93 if (const auto * low_cardinality_type = typeid_cast<const DataTypeLowCardinality *>(type.get()))
94 {
95 const auto & dict_type = low_cardinality_type->getDictionaryType();
96 if (dict_type->canBeInsideNullable())
97 return std::make_shared<DataTypeLowCardinality>(makeNullable(dict_type));
98 }
99
100 if (type->canBeInsideNullable())
101 return makeNullable(type);
102
103 return type;
104}
105
106
107DataTypePtr tryConvertTypeToNullable(const DataTypePtr & type)

Callers 15

parseMethod · 0.85
createNullSingleRowMethod · 0.85
visitJoinNodeMethod · 0.85
updatePipelineMethod · 0.85
makeOutputNullableMethod · 0.85
tryConvertTypeToNullableFunction · 0.85
convertColumnToNullableFunction · 0.85
convertColumnToNullable2Function · 0.85
analyzeAggregationMethod · 0.85
appendGroupByMethod · 0.85

Calls 4

isNullableFunction · 0.85
makeNullableFunction · 0.50
getMethod · 0.45
canBeInsideNullableMethod · 0.45

Tested by

no test coverage detected