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

Method CopyValues

cpp/src/arrow/util/hashing.h:494–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492 // Copy values starting from index `start` into `out_data`
493 template <typename Value>
494 void CopyValues(int32_t start, Value* out_data) const {
495 // So that both uint16_t and Float16 are allowed
496 static_assert(sizeof(Value) == sizeof(Scalar));
497 Scalar* out = reinterpret_cast<Scalar*>(out_data);
498 ARROW_DCHECK_OK(hash_table_.VisitEntries([=](const HashTableEntry* entry) {
499 int32_t index = entry->payload.memo_index - start;
500 if (index >= 0) {
501 out[index] = entry->payload.value;
502 }
503 return Status::OK();
504 }));
505 // Zero-initialize the null entry
506 if (null_index_ != kKeyNotFound) {
507 int32_t index = null_index_ - start;
508 if (index >= 0) {
509 out[index] = Scalar{};
510 }
511 }
512 }
513
514 template <typename Value>
515 void CopyValues(Value* out_data) const {

Callers 4

TESTFunction · 0.45
WriteDictMethod · 0.45

Calls 3

CopyValuesFunction · 0.85
VisitEntriesMethod · 0.80
OKFunction · 0.50

Tested by 1

TESTFunction · 0.36