MCPcopy Create free account
hub / github.com/apache/arrow / SetListData

Function SetListData

cpp/src/arrow/array/array_nested.cc:456–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

454
455template <typename TYPE>
456inline void SetListData(VarLengthListLikeArray<TYPE>* self,
457 const std::shared_ptr<ArrayData>& data,
458 Type::type expected_type_id) {
459 ARROW_CHECK_EQ(data->buffers.size(), is_list_view(TYPE::type_id) ? 3 : 2);
460 ARROW_CHECK_EQ(data->type->id(), expected_type_id);
461 ARROW_CHECK_EQ(data->child_data.size(), 1);
462
463 self->Array::SetData(data);
464
465 self->list_type_ = checked_cast<const TYPE*>(data->type.get());
466 self->raw_value_offsets_ = data->GetValuesSafe<typename TYPE::offset_type>(1);
467 // BaseListViewArray::SetData takes care of setting raw_value_sizes_.
468
469 ARROW_CHECK_EQ(self->list_type_->value_type()->id(), data->child_data[0]->type->id());
470 DCHECK(self->list_type_->value_type()->Equals(data->child_data[0]->type));
471 self->values_ = MakeArray(self->data_->child_data[0]);
472}
473
474Result<std::shared_ptr<Array>> FlattenLogicalListRecursively(const Array& in_array,
475 MemoryPool* memory_pool) {

Callers 1

SetDataMethod · 0.85

Calls 7

MakeArrayFunction · 0.70
is_list_viewFunction · 0.50
sizeMethod · 0.45
idMethod · 0.45
getMethod · 0.45
value_typeMethod · 0.45
EqualsMethod · 0.45

Tested by

no test coverage detected