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

Function GetTypeForBuffers

cpp/src/arrow/util/align_util.cc:47–59  ·  view source on GitHub ↗

Returns the type that controls how the buffers of this ArrayData (not its children) should behave

Source from the content-addressed store, hash-verified

45// Returns the type that controls how the buffers of this ArrayData (not its children)
46// should behave
47Type::type GetTypeForBuffers(const ArrayData& array) {
48 Type::type type_id = array.type->storage_id();
49 if (type_id == Type::DICTIONARY) {
50 // return index type id, provided by the DictionaryType array.type or
51 // array.type->storage_type() if array.type is an ExtensionType
52 DataType* dict_type = array.type.get();
53 if (array.type->id() == Type::EXTENSION) {
54 dict_type = checked_cast<ExtensionType*>(dict_type)->storage_type().get();
55 }
56 return checked_cast<DictionaryType*>(dict_type)->index_type()->id();
57 }
58 return type_id;
59}
60
61// Checks to see if an array's own buffers are aligned but doesn't check
62// children

Callers 2

CheckSelfAlignmentFunction · 0.85
EnsureAlignmentFunction · 0.85

Calls 4

storage_typeMethod · 0.80
index_typeMethod · 0.80
getMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected