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

Method OrcStructReader

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

Source from the content-addressed store, hash-verified

429}
430
431OrcStructReader::OrcStructReader(const orc::Type* node,
432 const TupleDescriptor* table_tuple_desc, HdfsOrcScanner* scanner)
433 : OrcComplexColumnReader(node, table_tuple_desc, scanner) {
434 bool needs_row_validation = table_tuple_desc == scanner_->scan_node_->tuple_desc() &&
435 node->getColumnId() == 0 &&
436 scanner_->row_batches_need_validation_;
437 if (materialize_tuple_) {
438 for (SlotDescriptor* child_slot : tuple_desc_->slots()) {
439 // Skip partition columns and missed columns
440 if (scanner->IsPartitionKeySlot(child_slot) ||
441 scanner->IsMissingField(child_slot) ||
442 child_slot->IsVirtual()) {
443 continue;
444 }
445 CreateChildForSlot(node, child_slot);
446 }
447 } else {
448 // No tuples should be materialized by this reader, because 'table_tuple_desc'
449 // matches to a descendant of 'node'. Those tuples should be materialized by the
450 // corresponding descendant reader. So 'node' should have exactly one selected
451 // subtype: the child in the path to the target descendant.
452 DCHECK_EQ(node->getSubtypeCount(), needs_row_validation ? 2 : 1);
453 int child_index = needs_row_validation ? 1 : 0;
454 OrcComplexColumnReader* child = OrcComplexColumnReader::CreateTopLevelReader(
455 node->getSubtype(child_index), table_tuple_desc, scanner);
456 children_.push_back(child);
457 children_fields_.push_back(child_index);
458 }
459 if (needs_row_validation) {
460 row_validator_.reset(new OrcRowValidator(scanner_->valid_write_ids_));
461 for (int i = 0; i < node->getSubtypeCount(); ++i) {
462 if (node->getSubtype(i)->getColumnId() == CURRENT_TRANSCACTION_TYPE_ID) {
463 current_write_id_field_index_ = i;
464 break;
465 }
466 }
467 }
468}
469
470OrcStructReader::OrcStructReader(const orc::Type* node, const SlotDescriptor* slot_desc,
471 const TupleDescriptor* children_tuple, HdfsOrcScanner* scanner)

Callers

nothing calls this directly

Calls 8

PrintNodeFunction · 0.85
IsPartitionKeySlotMethod · 0.80
IsMissingFieldMethod · 0.80
IsVirtualMethod · 0.80
push_backMethod · 0.80
resetMethod · 0.65
tuple_descMethod · 0.45
DebugStringMethod · 0.45

Tested by

no test coverage detected