MCPcopy Create free account
hub / github.com/apache/arrow / init_slot_ids

Method init_slot_ids

cpp/src/arrow/compute/key_map_internal.cc:176–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176void SwissTable::init_slot_ids(const int num_keys, const uint16_t* selection,
177 const uint32_t* hashes, const uint8_t* local_slots,
178 const uint8_t* match_bitvector,
179 uint32_t* out_slot_ids) const {
180 ARROW_DCHECK(selection);
181 if (log_blocks_ == 0) {
182 for (int i = 0; i < num_keys; ++i) {
183 uint16_t id = selection[i];
184 uint32_t match = ::arrow::bit_util::GetBit(match_bitvector, id) ? 1 : 0;
185 uint32_t slot_id = local_slots[id] + match;
186 out_slot_ids[id] = slot_id;
187 }
188 } else {
189 for (int i = 0; i < num_keys; ++i) {
190 uint16_t id = selection[i];
191 uint32_t hash = hashes[id];
192 uint32_t iblock = block_id_from_hash(hash, log_blocks_);
193 uint32_t match = ::arrow::bit_util::GetBit(match_bitvector, id) ? 1 : 0;
194 uint32_t slot_id = global_slot_id(iblock, local_slots[id] + match);
195 out_slot_ids[id] = slot_id;
196 }
197 }
198}
199
200void SwissTable::init_slot_ids_for_new_keys(uint32_t num_ids, const uint16_t* ids,
201 const uint32_t* hashes,

Callers

nothing calls this directly

Calls 3

block_id_from_hashFunction · 0.85
global_slot_idFunction · 0.85
GetBitFunction · 0.50

Tested by

no test coverage detected