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

Method getCSRArrowArrays

src/main/query_result/arrow_query_result.cpp:340–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340ArrowQueryResult::CSRArrowArrays ArrowQueryResult::getCSRArrowArrays() const {
341 if (!hasCSRMetadata()) {
342 throw RuntimeException("Arrow query result does not have CSR metadata.");
343 }
344 const CSRMetadata& merged = combineCSRChunks();
345 CSRArrowArrays result;
346 result.indptr =
347 makeCSRArrowArray(std::shared_ptr<const std::vector<int64_t>>(combinedCSR, &merged.indptr));
348 result.indices = makeCSRArrowArray(
349 std::shared_ptr<const std::vector<int64_t>>(combinedCSR, &merged.indices));
350 if (merged.hasEdgeIDs) {
351 result.edgeIDs = makeCSRArrowArray(
352 std::shared_ptr<const std::vector<int64_t>>(combinedCSR, &merged.edgeIDs));
353 }
354 return result;
355}
356
357const ArrowQueryResult::CSRMetadata& ArrowQueryResult::combineCSRChunks() const {
358 if (combinedCSR) {

Callers 2

TESTFunction · 0.80
TEST_FFunction · 0.80

Calls 1

makeCSRArrowArrayFunction · 0.85

Tested by 2

TESTFunction · 0.64
TEST_FFunction · 0.64