MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / copyVectorToBuffer

Method copyVectorToBuffer

src/storage/table/column_chunk_data.cpp:536–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534}
535
536void ColumnChunkData::copyVectorToBuffer(ValueVector* vector, offset_t startPosInChunk,
537 const SelectionView& selView) {
538 auto bufferToWrite = buffer->getBuffer().data() + startPosInChunk * numBytesPerValue;
539 DASSERT(startPosInChunk + selView.getSelSize() <= capacity);
540 const auto vectorDataToWriteFrom = vector->getData();
541 if (nullData) {
542 nullData->appendNulls(vector, selView, startPosInChunk);
543 }
544 if (selView.isUnfiltered()) {
545 memcpy(bufferToWrite, vectorDataToWriteFrom, selView.getSelSize() * numBytesPerValue);
546 } else {
547 selView.forEach([&](auto pos) {
548 memcpy(bufferToWrite, vectorDataToWriteFrom + pos * numBytesPerValue, numBytesPerValue);
549 bufferToWrite += numBytesPerValue;
550 });
551 }
552}
553
554void ColumnChunkData::setNumValues(uint64_t numValues_) {
555 DASSERT(numValues_ <= capacity);

Callers

nothing calls this directly

Calls 10

getBufferMethod · 0.80
getSelSizeMethod · 0.80
appendNullsMethod · 0.80
isUnfilteredMethod · 0.80
getDataFunction · 0.50
dataMethod · 0.45
getDataMethod · 0.45
forEachMethod · 0.45
getPhysicalTypeMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected