* '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. */
| 397 | * Returns false for not found. |
| 398 | */ |
| 399 | bool 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 | |
| 415 | void OrcStructReader::CreateChildForSlot(const orc::Type* curr_node, |
| 416 | const SlotDescriptor* slot_desc) { |
no test coverage detected