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

Function PrintCollection

be/src/util/debug-util.cc:169–183  ·  view source on GitHub ↗

Print a collection (array or map), recursing through the children. Example: [(a 1) (b 2)]

Source from the content-addressed store, hash-verified

167// Print a collection (array or map), recursing through the children.
168// Example: [(a 1) (b 2)]
169static void PrintCollection(const Tuple* t, const SlotDescriptor& slot_d,
170 stringstream* out) {
171 DCHECK(t != nullptr);
172 DCHECK(slot_d.type().IsCollectionType());
173 const TupleDescriptor* child_tuple_d = slot_d.children_tuple_descriptor();
174 const CollectionValue* coll_value =
175 reinterpret_cast<const CollectionValue*>(t->GetSlot(slot_d.tuple_offset()));
176 uint8_t* coll_buf = coll_value->ptr;
177 *out << "[";
178 for (int j = 0; j < coll_value->num_tuples; ++j) {
179 PrintTuple(reinterpret_cast<Tuple*>(coll_buf), *child_tuple_d, out);
180 coll_buf += child_tuple_d->byte_size();
181 }
182 *out << "]";
183}
184
185// Print a struct with field names, recursing to children. This is not intended to work
186// with impala_udf::StructVal. Instead, it works with the representation of structs

Callers 1

PrintSlotFunction · 0.85

Calls 7

PrintTupleFunction · 0.85
IsCollectionTypeMethod · 0.80
tuple_offsetMethod · 0.80
typeMethod · 0.45
GetSlotMethod · 0.45
byte_sizeMethod · 0.45

Tested by

no test coverage detected