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

Method ConvertOffsetsToPointers

be/src/runtime/tuple.cc:194–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194void Tuple::ConvertOffsetsToPointers(const TupleDescriptor& desc, uint8_t* tuple_data) {
195 vector<SlotDescriptor*>::const_iterator slot = desc.string_slots().begin();
196 for (; slot != desc.string_slots().end(); ++slot) {
197 DCHECK((*slot)->type().IsVarLenStringType());
198 if (IsNull((*slot)->null_indicator_offset())) continue;
199
200 StringValue* string_val = GetStringSlot((*slot)->tuple_offset());
201 if (string_val->IsSmall()) continue;
202 int offset = reinterpret_cast<intptr_t>(string_val->Ptr());
203 string_val->SetPtr(reinterpret_cast<char*>(tuple_data + offset));
204 }
205
206 slot = desc.collection_slots().begin();
207 for (; slot != desc.collection_slots().end(); ++slot) {
208 DCHECK((*slot)->type().IsCollectionType());
209 if (IsNull((*slot)->null_indicator_offset())) continue;
210
211 CollectionValue* coll_value = GetCollectionSlot((*slot)->tuple_offset());
212 int offset = reinterpret_cast<intptr_t>(coll_value->ptr);
213 coll_value->ptr = tuple_data + offset;
214
215 uint8_t* coll_data = coll_value->ptr;
216 const TupleDescriptor& item_desc = *(*slot)->children_tuple_descriptor();
217 for (int i = 0; i < coll_value->num_tuples; ++i) {
218 reinterpret_cast<Tuple*>(coll_data)->ConvertOffsetsToPointers(
219 item_desc, tuple_data);
220 coll_data += item_desc.byte_size();
221 }
222 }
223}
224
225void Tuple::SetNullIndicators(NullIndicatorOffset offset, int64_t num_tuples,
226 int64_t tuple_stride, uint8_t* tuple_mem) {

Callers 2

DeserializeMethod · 0.80
DeserializeMethod · 0.80

Calls 11

IsVarLenStringTypeMethod · 0.80
tuple_offsetMethod · 0.80
IsCollectionTypeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
typeMethod · 0.45
IsSmallMethod · 0.45
PtrMethod · 0.45
SetPtrMethod · 0.45
byte_sizeMethod · 0.45

Tested by

no test coverage detected