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

Method populateCSRHeader

src/processor/operator/persistent/rel_batch_insert.cpp:205–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205void RelBatchInsert::populateCSRHeader(const RelGroupCatalogEntry& relGroupEntry,
206 RelBatchInsertExecutionState& executionState, offset_t startNodeOffset,
207 const RelBatchInsertInfo& relInfo, const RelBatchInsertLocalState& localState,
208 offset_t numNodes, bool leaveGaps) {
209 auto& csrNodeGroup = dynamic_cast_checked<InMemChunkedCSRNodeGroup&>(*localState.chunkedGroup);
210 auto& csrHeader = csrNodeGroup.getCSRHeader();
211 csrHeader.setNumValues(numNodes);
212 // Populate lengths for each node and check multiplicity constraint.
213 impl->populateCSRLengths(executionState, csrHeader, numNodes, relInfo);
214 checkRelMultiplicityConstraint(relGroupEntry, csrHeader, startNodeOffset, relInfo);
215 const auto rightCSROffsetOfRegions = csrHeader.populateStartCSROffsetsFromLength(leaveGaps);
216 impl->finalizeStartCSROffsets(executionState, csrHeader, relInfo);
217 csrHeader.finalizeCSRRegionEndOffsets(rightCSROffsetOfRegions);
218 // Resize csr data column chunks.
219 localState.chunkedGroup->resizeChunks(csrHeader.getEndCSROffset(numNodes - 1));
220 localState.chunkedGroup->resetToAllNull();
221 DASSERT(csrHeader.sanityCheck());
222}
223
224void RelBatchInsert::checkRelMultiplicityConstraint(const RelGroupCatalogEntry& relGroupEntry,
225 const InMemChunkedCSRHeader& csrHeader, offset_t startNodeOffset,

Callers

nothing calls this directly

Calls 9

populateCSRLengthsMethod · 0.80
resizeChunksMethod · 0.80
getEndCSROffsetMethod · 0.80
setNumValuesMethod · 0.45
resetToAllNullMethod · 0.45
sanityCheckMethod · 0.45

Tested by

no test coverage detected