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

Method WrapArray

cpp/src/arrow/extension_type.cc:55–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55std::shared_ptr<Array> ExtensionType::WrapArray(const std::shared_ptr<DataType>& type,
56 const std::shared_ptr<Array>& storage) {
57 DCHECK_EQ(type->id(), Type::EXTENSION);
58 const auto& ext_type = checked_cast<const ExtensionType&>(*type);
59 DCHECK_EQ(storage->type_id(), ext_type.storage_type()->id());
60 auto data = storage->data()->Copy();
61 data->type = type;
62 return ext_type.MakeArray(std::move(data));
63}
64
65std::shared_ptr<ChunkedArray> ExtensionType::WrapArray(
66 const std::shared_ptr<DataType>& type, const std::shared_ptr<ChunkedArray>& storage) {

Callers 2

VisitMethod · 0.80
MakeArrayFromScalarFunction · 0.80

Calls 8

storage_typeMethod · 0.80
idMethod · 0.45
type_idMethod · 0.45
CopyMethod · 0.45
dataMethod · 0.45
MakeArrayMethod · 0.45
typeMethod · 0.45
num_chunksMethod · 0.45

Tested by

no test coverage detected