MCPcopy Create free account
hub / github.com/apache/impala / CopyStrings

Method CopyStrings

be/src/runtime/tuple-ir.cc:27–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25void Tuple::dummy(Tuple::CodegenTypes*) {}
26
27bool Tuple::CopyStrings(const char* err_ctx, RuntimeState* state,
28 const SlotOffsets* string_slot_offsets, int num_string_slots, MemPool* pool,
29 Status* status) noexcept {
30 int64_t total_len = 0;
31 for (int i = 0; i < num_string_slots; ++i) {
32 if (IsNull(string_slot_offsets[i].null_indicator_offset)) continue;
33 StringValue* sv = GetStringSlot(string_slot_offsets[i].tuple_offset);
34 if (sv->IsSmall()) continue;
35 total_len += sv->Len();
36 }
37 char* buf = AllocateStrings(err_ctx, state, total_len, pool, status);
38 if (UNLIKELY(buf == nullptr)) return false;
39 for (int i = 0; i < num_string_slots; ++i) {
40 if (IsNull(string_slot_offsets[i].null_indicator_offset)) continue;
41 StringValue* sv = GetStringSlot(string_slot_offsets[i].tuple_offset);
42 if (sv->IsSmall()) continue;
43 StringValue::SimpleString s = sv->ToSimpleString();
44 if (s.len == 0) continue;
45 memcpy(buf, s.ptr, s.len);
46 sv->SetPtr(buf);
47 buf += s.len;
48 }
49 return true;
50}
51
52template<class T>
53bool TryMemCopy(uint8_t* dst, const uint8_t* dst_end, int size, const T* src) {

Callers 3

WriteAlignedTuplesMethod · 0.45
ProcessRangeMethod · 0.45
DecodeAvroDataMethod · 0.45

Calls 4

IsSmallMethod · 0.45
LenMethod · 0.45
ToSimpleStringMethod · 0.45
SetPtrMethod · 0.45

Tested by

no test coverage detected