| 394 | } |
| 395 | |
| 396 | void ColumnChunkData::write(ColumnChunkData* chunk, ColumnChunkData* dstOffsets, |
| 397 | RelMultiplicity multiplicity) { |
| 398 | DASSERT(chunk->dataType.getPhysicalType() == dataType.getPhysicalType() && |
| 399 | dstOffsets->getDataType().getPhysicalType() == PhysicalTypeID::INTERNAL_ID && |
| 400 | chunk->getNumValues() == dstOffsets->getNumValues()); |
| 401 | for (auto i = 0u; i < dstOffsets->getNumValues(); i++) { |
| 402 | const auto dstOffset = dstOffsets->getValue<offset_t>(i); |
| 403 | DASSERT(dstOffset < capacity); |
| 404 | memcpy(getData() + dstOffset * numBytesPerValue, chunk->getData() + i * numBytesPerValue, |
| 405 | numBytesPerValue); |
| 406 | numValues = dstOffset >= numValues ? dstOffset + 1 : numValues; |
| 407 | } |
| 408 | if (nullData || multiplicity == RelMultiplicity::ONE) { |
| 409 | for (auto i = 0u; i < dstOffsets->getNumValues(); i++) { |
| 410 | const auto dstOffset = dstOffsets->getValue<offset_t>(i); |
| 411 | if (multiplicity == RelMultiplicity::ONE && isNull(dstOffset)) { |
| 412 | throw CopyException( |
| 413 | std::format("Node with offset: {} can only have one neighbour due " |
| 414 | "to the MANY-ONE/ONE-ONE relationship constraint.", |
| 415 | dstOffset)); |
| 416 | } |
| 417 | if (nullData) { |
| 418 | nullData->setNull(dstOffset, chunk->isNull(i)); |
| 419 | } |
| 420 | } |
| 421 | } |
| 422 | updateInMemoryStats(inMemoryStats, chunk); |
| 423 | } |
| 424 | |
| 425 | // NOTE: This function is only called in LocalTable right now when |
| 426 | // performing out-of-place committing. LIST has a different logic for |
nothing calls this directly
no test coverage detected