| 984 | } |
| 985 | |
| 986 | void HdfsScanNodeBase::InitNullCollectionValues(const TupleDescriptor* tuple_desc, |
| 987 | Tuple* tuple) const { |
| 988 | for (const SlotDescriptor* slot_desc: tuple_desc->collection_slots()) { |
| 989 | CollectionValue* slot = reinterpret_cast<CollectionValue*>( |
| 990 | tuple->GetSlot(slot_desc->tuple_offset())); |
| 991 | if (tuple->IsNull(slot_desc->null_indicator_offset())) { |
| 992 | *slot = CollectionValue(); |
| 993 | continue; |
| 994 | } |
| 995 | // Recursively traverse collection items. |
| 996 | const TupleDescriptor* item_desc = slot_desc->children_tuple_descriptor(); |
| 997 | if (item_desc->collection_slots().empty()) continue; |
| 998 | for (int i = 0; i < slot->num_tuples; ++i) { |
| 999 | int item_offset = i * item_desc->byte_size(); |
| 1000 | Tuple* collection_item = reinterpret_cast<Tuple*>(slot->ptr + item_offset); |
| 1001 | InitNullCollectionValues(item_desc, collection_item); |
| 1002 | } |
| 1003 | } |
| 1004 | } |
| 1005 | |
| 1006 | void HdfsScanNodeBase::InitNullCollectionValues(RowBatch* row_batch) const { |
| 1007 | DCHECK_EQ(row_batch->row_desc()->tuple_descriptors().size(), 1); |
nothing calls this directly
no test coverage detected