Recursively makes empty RowVectors for positions in 'children' where the corresponding child type in 'rowType' is a row. The reader expects RowVector outputs to be initialized so that the content corresponds to the query schema regardless of the file schema. An empty RowVector can have nullptr for all its non-row children.
| 275 | // content corresponds to the query schema regardless of the file |
| 276 | // schema. An empty RowVector can have nullptr for all its non-row |
| 277 | // children. |
| 278 | void fillRowVectorChildren( |
| 279 | memory::MemoryPool& pool, |
| 280 | const RowType& rowType, |
| 281 | std::vector<VectorPtr>& children) { |
| 282 | for (auto i = 0; i < children.size(); ++i) { |
| 283 | const auto& type = rowType.childAt(i); |
| 284 | if (type->isRow()) { |
| 285 | std::vector<VectorPtr> innerChildren(type->size()); |
| 286 | fillRowVectorChildren(pool, type->asRow(), innerChildren); |
| 287 | children[i] = std::make_shared<RowVector>( |
| 288 | &pool, type, nullptr, 0, std::move(innerChildren)); |
| 289 | } |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | VectorPtr tryReuseResult(const VectorPtr& result) { |