| 244 | } |
| 245 | |
| 246 | void 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 | |
| 270 | static bool isPrefix(const PathInData::Parts & prefix, const PathInData::Parts & parts) |
| 271 | { |
no test coverage detected