| 1030 | } |
| 1031 | |
| 1032 | void deeplake_table_am_routine::multi_insert(Relation rel, |
| 1033 | TupleTableSlot** slots, |
| 1034 | int32_t nslots, |
| 1035 | CommandId cid, |
| 1036 | int32_t options, |
| 1037 | struct BulkInsertStateData* bistate) |
| 1038 | { |
| 1039 | // Check PostgreSQL memory limits before multi-insert |
| 1040 | memory_tracker::check_memory_limit(); |
| 1041 | const auto table_id = RelationGetRelid(rel); |
| 1042 | const auto& table_data = table_storage::instance().get_table_data(table_id); |
| 1043 | const auto row_number = table_data.num_total_rows(); |
| 1044 | try { |
| 1045 | table_storage::instance().insert_slots(table_id, nslots, slots); |
| 1046 | } catch (const std::exception& e) { |
| 1047 | ereport(ERROR, |
| 1048 | (errcode(ERRCODE_INTERNAL_ERROR), |
| 1049 | errmsg("Failed to insert tuples: %s", e.what()), |
| 1050 | errdetail("Table name: %s, Dataset path: %s", |
| 1051 | get_qualified_table_name(rel).c_str(), |
| 1052 | pg::table_options::current().dataset_path().c_str()), |
| 1053 | errhint("Check if the dataset path is accessible and has proper permissions"))); |
| 1054 | } |
| 1055 | for (auto i = 0; i < nslots; ++i) { |
| 1056 | const auto [block_number, offset_number] = utils::row_number_to_tid(row_number + i); |
| 1057 | ItemPointerSet(&slots[i]->tts_tid, block_number, offset_number); |
| 1058 | } |
| 1059 | |
| 1060 | // Report to statistics collector |
| 1061 | pgstat_count_heap_insert(rel, nslots); |
| 1062 | |
| 1063 | // Increment version to notify other backends |
| 1064 | table_version_tracker::increment_version(table_id); |
| 1065 | } |
| 1066 | |
| 1067 | TM_Result deeplake_table_am_routine::tuple_delete(Relation rel, |
| 1068 | ItemPointer tid, |
nothing calls this directly
no test coverage detected