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

Function lbug_connection_create_arrow_rel_table_csr

src/c_api/connection.cpp:277–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277lbug_state lbug_connection_create_arrow_rel_table_csr(lbug_connection* connection,
278 const char* table_name, const char* src_table_name, const char* dst_table_name,
279 ArrowSchema* indices_schema, ArrowArray* indices_arrays, uint64_t num_indices_arrays,
280 ArrowSchema* indptr_schema, ArrowArray* indptr_arrays, uint64_t num_indptr_arrays,
281 const char* dst_col_name, lbug_query_result* out_query_result) {
282 if (connection == nullptr || connection->_connection == nullptr || table_name == nullptr ||
283 src_table_name == nullptr || dst_table_name == nullptr || indices_schema == nullptr ||
284 indices_arrays == nullptr || indptr_schema == nullptr || indptr_arrays == nullptr ||
285 out_query_result == nullptr) {
286 return LbugError;
287 }
288 try {
289 clearLastCAPIErrorMessage();
290 auto result = lbug::ArrowTableSupport::createRelTableFromArrowCSR(
291 *static_cast<Connection*>(connection->_connection), table_name, src_table_name,
292 dst_table_name, takeArrowSchema(indices_schema),
293 takeArrowArrays(indices_arrays, num_indices_arrays), takeArrowSchema(indptr_schema),
294 takeArrowArrays(indptr_arrays, num_indptr_arrays),
295 dst_col_name != nullptr ? dst_col_name : "to");
296 auto state = setQueryResult(std::move(result.queryResult), out_query_result);
297 if (state == LbugSuccess) {
298 rememberArrowTableID(static_cast<Connection*>(connection->_connection), table_name,
299 std::move(result.arrowId));
300 }
301 return state;
302 } catch (Exception& e) {
303 setLastCAPIErrorMessage(e.what());
304 return LbugError;
305 }
306}
307
308lbug_state lbug_connection_drop_arrow_table(lbug_connection* connection, const char* table_name,
309 lbug_query_result* out_query_result) {

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