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

Function createComplexCsrRelTable

test/api/arrow_csr_rel_table_test.cpp:144–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144void createComplexCsrRelTable(main::Connection& connection, bool withBwd = false,
145 bool splitIndices = false, bool splitIndptr = false, const std::string& tableName = "csr_knows",
146 const std::string& nodeTableName = "csr_node") {
147 std::vector<ArrowArrayWrapper> fwdIndices;
148 if (splitIndices) {
149 fwdIndices.push_back(makeCsrEdgeBatch({getFwdEdges()[0], getFwdEdges()[1]}));
150 fwdIndices.push_back(makeCsrEdgeBatch({getFwdEdges()[2], getFwdEdges()[3]}));
151 } else {
152 fwdIndices.push_back(makeCsrEdgeBatch(getFwdEdges()));
153 }
154
155 std::vector<ArrowArrayWrapper> fwdIndptr;
156 if (splitIndptr) {
157 fwdIndptr.push_back(makeIndptrBatch({0, 2, 3}));
158 fwdIndptr.push_back(makeIndptrBatch({4, 4, 4}));
159 } else {
160 fwdIndptr.push_back(makeIndptrBatch({0, 2, 3, 4, 4, 4}));
161 }
162
163 // This branch only exposes forward CSR arrays; backward scans exercise the fallback path.
164 (void)withBwd;
165 auto result = ArrowTableSupport::createRelTableFromArrowCSR(connection, tableName,
166 nodeTableName, nodeTableName, makeComplexFwdIndicesSchema(), std::move(fwdIndices),
167 makeComplexIndptrSchema(), std::move(fwdIndptr));
168 ASSERT_TRUE(result.queryResult->isSuccess()) << result.queryResult->getErrorMessage();
169}
170
171} // namespace
172

Callers 1

TEST_FFunction · 0.85

Calls 7

makeComplexIndptrSchemaFunction · 0.85
makeCsrEdgeBatchFunction · 0.70
makeIndptrBatchFunction · 0.70
push_backMethod · 0.45
isSuccessMethod · 0.45
getErrorMessageMethod · 0.45

Tested by

no test coverage detected