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

Function createCsrRelTable

test/api/arrow_drop_table_test.cpp:229–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229void createCsrRelTable(main::Connection& connection, const std::string& tableName = "csr_knows",
230 const char* weightName = "weight") {
231 std::vector<ArrowArrayWrapper> indices;
232 indices.push_back(makeCsrEdgeBatch(
233 {{1, 10, "ab", DATE_2020_01_01, {1}}, {2, 20, "ac", DATE_2021_01_01, {1, 2}},
234 {2, 30, "bc", DATE_2022_01_01, {1}}, {3, 40, "gd", DATE_2023_01_01, {2}}}));
235 std::vector<ArrowArrayWrapper> indptr;
236 indptr.push_back(createStructArray(6,
237 {[](ArrowArray* array) { createUint64Array(array, {0, 2, 3, 4, 4, 4}); }}));
238 auto result = ArrowTableSupport::createRelTableFromArrowCSR(connection, tableName, "csr_node",
239 "csr_node", makeCsrIndexSchema(weightName), std::move(indices), makeIndptrSchema(),
240 std::move(indptr));
241 ASSERT_TRUE(result.queryResult->isSuccess()) << result.queryResult->getErrorMessage();
242}
243
244} // namespace
245

Callers 1

TEST_FFunction · 0.85

Calls 8

createStructArrayFunction · 0.85
createUint64ArrayFunction · 0.85
makeCsrIndexSchemaFunction · 0.85
makeIndptrSchemaFunction · 0.85
makeCsrEdgeBatchFunction · 0.70
push_backMethod · 0.45
isSuccessMethod · 0.45
getErrorMessageMethod · 0.45

Tested by

no test coverage detected