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

Function createArrowPersonTable

test/api/arrow_rel_table_test.cpp:232–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232static void createArrowPersonTable(main::Connection& connection) {
233 std::vector<int64_t> ids = {1, 2, 3};
234 std::vector<std::string> names = {"Alice", "Bob", "Carol"};
235
236 ArrowSchemaWrapper schema;
237 createStructSchema(&schema, 2);
238 createSchema<int64_t>(schema.children[0], "id");
239 createSchema<std::string>(schema.children[1], "name");
240
241 std::vector<ArrowArrayWrapper> arrays;
242 arrays.push_back(createStructArray(ids.size(),
243 {[&](ArrowArray* array) { createInt64Array(array, ids); },
244 [&](ArrowArray* array) { createStringArray(array, names); }}));
245
246 auto result = ArrowTableSupport::createViewFromArrowTable(connection, "arrow_rel_person",
247 std::move(schema), std::move(arrays));
248 ASSERT_TRUE(result.queryResult->isSuccess()) << result.queryResult->getErrorMessage();
249}
250
251static void createNativePersonTable(main::Connection& connection) {
252 auto result = connection.query(

Callers 1

TEST_FFunction · 0.85

Calls 8

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

Tested by

no test coverage detected