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

Function lbug_connection_create_arrow_table

src/c_api/connection.cpp:227–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227lbug_state lbug_connection_create_arrow_table(lbug_connection* connection, const char* table_name,
228 ArrowSchema* schema, ArrowArray* arrays, uint64_t num_arrays,
229 lbug_query_result* out_query_result) {
230 if (connection == nullptr || connection->_connection == nullptr || table_name == nullptr ||
231 schema == nullptr || arrays == nullptr || out_query_result == nullptr) {
232 return LbugError;
233 }
234 try {
235 clearLastCAPIErrorMessage();
236 auto result = lbug::ArrowTableSupport::createViewFromArrowTable(
237 *static_cast<Connection*>(connection->_connection), table_name, takeArrowSchema(schema),
238 takeArrowArrays(arrays, num_arrays));
239 auto state = setQueryResult(std::move(result.queryResult), out_query_result);
240 if (state == LbugSuccess) {
241 rememberArrowTableID(static_cast<Connection*>(connection->_connection), table_name,
242 std::move(result.arrowId));
243 }
244 return state;
245 } catch (Exception& e) {
246 setLastCAPIErrorMessage(e.what());
247 return LbugError;
248 }
249}
250
251lbug_state lbug_connection_create_arrow_rel_table(lbug_connection* connection,
252 const char* table_name, const char* src_table_name, const char* dst_table_name,

Callers

nothing calls this directly

Calls 7

takeArrowSchemaFunction · 0.85
takeArrowArraysFunction · 0.85
setQueryResultFunction · 0.85
rememberArrowTableIDFunction · 0.85
setLastCAPIErrorMessageFunction · 0.85
whatMethod · 0.80

Tested by

no test coverage detected