| 391 | } |
| 392 | |
| 393 | uint8_t* FactorizedTable::allocateUnflatTupleBlock(uint32_t numBytes) { |
| 394 | if (unFlatTupleBlockCollection->isEmpty()) { |
| 395 | auto newBlock = std::make_unique<DataBlock>(memoryManager, getDataBlockSize(numBytes)); |
| 396 | unFlatTupleBlockCollection->append(std::move(newBlock)); |
| 397 | } |
| 398 | auto lastBlock = unFlatTupleBlockCollection->getLastBlock(); |
| 399 | if (lastBlock->freeSize > numBytes) { |
| 400 | auto writableData = lastBlock->getWritableData(); |
| 401 | lastBlock->freeSize -= numBytes; |
| 402 | return writableData; |
| 403 | } |
| 404 | auto newBlock = std::make_unique<DataBlock>(memoryManager, getDataBlockSize(numBytes)); |
| 405 | unFlatTupleBlockCollection->append(std::move(newBlock)); |
| 406 | lastBlock = unFlatTupleBlockCollection->getLastBlock(); |
| 407 | lastBlock->freeSize -= numBytes; |
| 408 | return lastBlock->getData(); |
| 409 | } |
| 410 | |
| 411 | void FactorizedTable::copyFlatVectorToFlatColumn(const ValueVector& vector, |
| 412 | const BlockAppendingInfo& blockAppendInfo, ft_col_idx_t colIdx) { |
nothing calls this directly
no test coverage detected