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

Function sanitizeBlock

src/Interpreters/ExpressionAnalyzer.cpp:158–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158bool sanitizeBlock(Block & block, bool throw_if_cannot_create_column)
159{
160 for (auto & col : block)
161 {
162 if (!col.column)
163 {
164 if (isNotCreatable(col.type->getTypeId()))
165 {
166 if (throw_if_cannot_create_column)
167 throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Cannot create column of type {}", col.type->getName());
168
169 return false;
170 }
171
172 col.column = col.type->createColumn();
173 }
174 else if (!col.column->empty())
175 col.column = col.column->cloneEmpty();
176 }
177 return true;
178}
179
180ExpressionAnalyzerData::ExpressionAnalyzerData() = default;
181

Callers 3

tryCreateJoinFunction · 0.85

Calls 6

ExceptionClass · 0.70
getTypeIdMethod · 0.45
getNameMethod · 0.45
createColumnMethod · 0.45
emptyMethod · 0.45
cloneEmptyMethod · 0.45

Tested by

no test coverage detected