| 338 | } |
| 339 | |
| 340 | ArrowQueryResult::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 | |
| 357 | const ArrowQueryResult::CSRMetadata& ArrowQueryResult::combineCSRChunks() const { |
| 358 | if (combinedCSR) { |