| 40 | } |
| 41 | |
| 42 | void DataChunkCollection::allocateChunk(const DataChunk& chunk) { |
| 43 | if (chunks.empty()) { |
| 44 | types.reserve(chunk.getNumValueVectors()); |
| 45 | for (auto vectorIdx = 0u; vectorIdx < chunk.getNumValueVectors(); vectorIdx++) { |
| 46 | types.push_back(chunk.getValueVector(vectorIdx).dataType.copy()); |
| 47 | } |
| 48 | } |
| 49 | DataChunk newChunk(types.size(), std::make_shared<DataChunkState>()); |
| 50 | for (auto i = 0u; i < types.size(); i++) { |
| 51 | newChunk.insert(i, std::make_shared<ValueVector>(types[i].copy(), mm)); |
| 52 | } |
| 53 | chunks.push_back(std::move(newChunk)); |
| 54 | } |
| 55 | |
| 56 | } // namespace common |
| 57 | } // namespace lbug |