| 148 | } |
| 149 | |
| 150 | uint64_t ChunkedNodeGroup::append(const Transaction* transaction, |
| 151 | const std::vector<ValueVector*>& columnVectors, row_idx_t startRowInVectors, |
| 152 | uint64_t numValuesToAppend) { |
| 153 | DASSERT(residencyState != ResidencyState::ON_DISK); |
| 154 | DASSERT(columnVectors.size() == chunks.size()); |
| 155 | const auto numRowsToAppendInChunk = std::min(numValuesToAppend, capacity - numRows); |
| 156 | try { |
| 157 | for (auto i = 0u; i < columnVectors.size(); i++) { |
| 158 | const auto columnVector = columnVectors[i]; |
| 159 | chunks[i]->append(columnVector, columnVector->state->getSelVector().slice( |
| 160 | startRowInVectors, numRowsToAppendInChunk)); |
| 161 | } |
| 162 | } catch ([[maybe_unused]] std::exception& e) { |
| 163 | handleAppendException(chunks, numRows); |
| 164 | } |
| 165 | if (transaction->shouldAppendToUndoBuffer()) { |
| 166 | if (!versionInfo) { |
| 167 | versionInfo = std::make_unique<VersionInfo>(); |
| 168 | } |
| 169 | versionInfo->append(transaction->getID(), numRows, numRowsToAppendInChunk); |
| 170 | } |
| 171 | numRows += numRowsToAppendInChunk; |
| 172 | return numRowsToAppendInChunk; |
| 173 | } |
| 174 | |
| 175 | offset_t ChunkedNodeGroup::append(const Transaction* transaction, |
| 176 | const std::vector<column_id_t>& columnIDs, const ChunkedNodeGroup& other, |
no test coverage detected