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

Function convertDynamicColumnsToTuples

src/DataTypes/ObjectUtils.cpp:246–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246void convertDynamicColumnsToTuples(Block & block, const StorageSnapshotPtr & storage_snapshot)
247{
248 for (auto & column : block)
249 {
250 if (!column.type->hasDynamicSubcolumns())
251 continue;
252
253 std::tie(column.column, column.type) = recursivelyConvertDynamicColumnToTuple(column.column, column.type);
254
255 GetColumnsOptions options(GetColumnsOptions::AllPhysical);
256 auto storage_column = storage_snapshot->tryGetColumn(options, column.name);
257 if (!storage_column)
258 throw Exception(ErrorCodes::LOGICAL_ERROR, "Column '{}' not found in storage", column.name);
259
260 if (needCheckTypeCompatibilityLocal(storage_snapshot->storage))
261 {
262 auto storage_column_concrete = storage_snapshot->getColumn(options.withExtendedObjects(), column.name);
263
264 /// Check that constructed Tuple type and type in storage are compatible.
265 getLeastCommonTypeForDynamicColumns(storage_column->type, {column.type, storage_column_concrete.type}, true);
266 }
267 }
268}
269
270static bool isPrefix(const PathInData::Parts & prefix, const PathInData::Parts & parts)
271{

Callers 2

writeMethod · 0.85
writeTempPartMethod · 0.85

Calls 7

ExceptionClass · 0.50
hasDynamicSubcolumnsMethod · 0.45
tryGetColumnMethod · 0.45
getColumnMethod · 0.45

Tested by

no test coverage detected