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

Function reconstructTupleColumnsRecursive

src/DataTypes/NestedUtils.cpp:435–457  ·  view source on GitHub ↗

Reconstruct tuple columns: input header and flattened columns, return a new vector with tuples reconstructed

Source from the content-addressed store, hash-verified

433
434/// Reconstruct tuple columns: input header and flattened columns, return a new vector with tuples reconstructed
435Columns reconstructTupleColumnsRecursive(const Block & header, const Columns & flattened_columns)
436{
437 Columns result;
438 result.reserve(header.columns());
439 size_t flattened_idx = 0;
440
441 for (size_t i = 0; i < header.columns(); ++i)
442 {
443 const auto & header_col = header.getByPosition(i);
444 result.push_back(reconstructTupleColumnImpl(header_col.type, flattened_columns, flattened_idx));
445 }
446
447 if (flattened_idx != flattened_columns.size())
448 {
449 throw Exception(
450 ErrorCodes::LOGICAL_ERROR,
451 "reconstructTupleColumnsRecursive: consumed {} flattened columns, but total flattened columns count is {}",
452 flattened_idx,
453 flattened_columns.size());
454 }
455
456 return result;
457}
458
459namespace
460{

Callers 2

postprocessChunkFunction · 0.85
postprocessChunkFunction · 0.85

Calls 6

columnsMethod · 0.80
ExceptionClass · 0.50
reserveMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected