| 593 | } |
| 594 | |
| 595 | RowVectorPtr wrapColumns( |
| 596 | const RowVector* input, |
| 597 | const std::vector<column_index_t>& channels, |
| 598 | const RowTypePtr& types, |
| 599 | memory::MemoryPool* pool) { |
| 600 | BOLT_CHECK_NOT_NULL(input); |
| 601 | |
| 602 | std::vector<VectorPtr> children; |
| 603 | children.reserve(channels.size()); |
| 604 | for (auto& channel : channels) |
| 605 | children.push_back(input->childAt(channel)); |
| 606 | |
| 607 | // Preserve row-level nulls if present on the input RowVector; otherwise |
| 608 | // nullptr. |
| 609 | BufferPtr rowNulls = input->nulls(); |
| 610 | |
| 611 | return std::make_shared<RowVector>( |
| 612 | pool, types, rowNulls, input->size(), children); |
| 613 | } |
| 614 | |
| 615 | } // namespace bytedance::bolt::exec |