MCPcopy Create free account
hub / github.com/activeloopai/deeplake / add_insert_slots

Method add_insert_slots

cpp/deeplake_pg/table_data_impl.hpp:327–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327inline void table_data::add_insert_slots(int32_t nslots, TupleTableSlot** slots)
328{
329 for (int32_t k = 0; k < nslots; ++k) {
330 auto slot = slots[k];
331 slot_getallattrs(slot);
332 }
333 for (int32_t i = 0; i < num_columns(); ++i) {
334 auto& column_values = insert_rows_[get_atttypename(i)];
335 const auto dt = get_column_view(i)->dtype();
336 const auto slot_pos = get_tupdesc_index(i);
337 for (int32_t k = 0; k < nslots; ++k) {
338 auto slot = slots[k];
339 nd::array val;
340 if (slot->tts_isnull[slot_pos]) {
341 val = (nd::dtype_is_numeric(dt) ? nd::adapt(0) : nd::none(dt, 0));
342 } else {
343 val = pg::utils::datum_to_nd(slot->tts_values[slot_pos], get_base_atttypid(i), get_atttypmod(i));
344 }
345 column_values.push_back(std::move(val));
346 }
347 }
348 num_total_rows_ += nslots;
349 const auto num_inserts = insert_rows_.begin()->second.size();
350 if (num_inserts >= 512) {
351 flush_inserts();
352 }
353}
354
355inline void table_data::add_delete_row(int64_t row_id)
356{

Callers 1

insert_slotsMethod · 0.80

Calls 7

dtype_is_numericFunction · 0.85
adaptFunction · 0.85
datum_to_ndFunction · 0.85
dtypeMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected