| 249 | } |
| 250 | |
| 251 | lbug_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, |
| 253 | ArrowSchema* schema, ArrowArray* arrays, uint64_t num_arrays, |
| 254 | lbug_query_result* out_query_result) { |
| 255 | if (connection == nullptr || connection->_connection == nullptr || table_name == nullptr || |
| 256 | src_table_name == nullptr || dst_table_name == nullptr || schema == nullptr || |
| 257 | arrays == nullptr || out_query_result == nullptr) { |
| 258 | return LbugError; |
| 259 | } |
| 260 | try { |
| 261 | clearLastCAPIErrorMessage(); |
| 262 | auto result = lbug::ArrowTableSupport::createRelTableFromArrowTable( |
| 263 | *static_cast<Connection*>(connection->_connection), table_name, src_table_name, |
| 264 | dst_table_name, takeArrowSchema(schema), takeArrowArrays(arrays, num_arrays)); |
| 265 | auto state = setQueryResult(std::move(result.queryResult), out_query_result); |
| 266 | if (state == LbugSuccess) { |
| 267 | rememberArrowTableID(static_cast<Connection*>(connection->_connection), table_name, |
| 268 | std::move(result.arrowId)); |
| 269 | } |
| 270 | return state; |
| 271 | } catch (Exception& e) { |
| 272 | setLastCAPIErrorMessage(e.what()); |
| 273 | return LbugError; |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | lbug_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, |
nothing calls this directly
no test coverage detected