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

Function createArrowKnowsTable

test/api/arrow_rel_table_test.cpp:260–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260static void createArrowKnowsTable(main::Connection& connection) {
261 std::vector<int64_t> from = {1, 1, 2};
262 std::vector<int64_t> to = {2, 3, 3};
263 std::vector<int64_t> weight = {10, 20, 30};
264
265 ArrowSchemaWrapper schema;
266 createStructSchema(&schema, 3);
267 createSchema<int64_t>(schema.children[0], "from");
268 createSchema<int64_t>(schema.children[1], "to");
269 createSchema<int64_t>(schema.children[2], "weight");
270
271 std::vector<ArrowArrayWrapper> arrays;
272 arrays.push_back(createStructArray(from.size(),
273 {[&](ArrowArray* array) { createInt64Array(array, from); },
274 [&](ArrowArray* array) { createInt64Array(array, to); },
275 [&](ArrowArray* array) { createInt64Array(array, weight); }}));
276
277 auto result = ArrowTableSupport::createRelTableFromArrowTable(connection, "arrow_rel_knows",
278 "arrow_rel_person", "arrow_rel_person", std::move(schema), std::move(arrays));
279 ASSERT_TRUE(result.queryResult->isSuccess()) << result.queryResult->getErrorMessage();
280}
281
282void createComplexArrowPersonTable(main::Connection& connection,
283 const std::string& tableName = "person") {

Callers 1

TEST_FFunction · 0.85

Calls 7

createStructSchemaFunction · 0.85
createStructArrayFunction · 0.85
createInt64ArrayFunction · 0.85
push_backMethod · 0.45
sizeMethod · 0.45
isSuccessMethod · 0.45
getErrorMessageMethod · 0.45

Tested by

no test coverage detected