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

Function FindChild

be/src/exec/orc/orc-column-readers.cc:399–413  ·  view source on GitHub ↗

* 'parent' is a complex type that might have multiple children, i.e. STRUCT or MAP. * 'descendant_col_id' refers to an ORC type somewhere under 'parent' in the type * hieararchy. This method selects the direct child of 'parent' that is also the ancestor * of 'descendant_col_id'. Return the result in '*child' and its index in '*field'. * Returns false for not found. */

Source from the content-addressed store, hash-verified

397 * Returns false for not found.
398 */
399bool FindChild(const orc::Type& parent, uint64_t descendant_col_id,
400 const orc::Type** child, int* field) {
401 DCHECK(parent.getKind() == orc::TypeKind::STRUCT ||
402 parent.getKind() == orc::TypeKind::MAP);
403 int size = parent.getSubtypeCount();
404 for (int c = 0; c < size; ++c) {
405 const orc::Type* node = parent.getSubtype(c);
406 if (node && IsDescendant(*node, descendant_col_id)) {
407 *child = node;
408 *field = c;
409 return true;
410 }
411 }
412 return false;
413}
414
415void OrcStructReader::CreateChildForSlot(const orc::Type* curr_node,
416 const SlotDescriptor* slot_desc) {

Callers 2

CreateChildForSlotMethod · 0.85
OrcMapReaderMethod · 0.85

Calls 2

IsDescendantFunction · 0.85
getKindMethod · 0.80

Tested by

no test coverage detected