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

Function MutableFixedWidthValuesPointer

cpp/src/arrow/util/fixed_width_internal.cc:215–230  ·  view source on GitHub ↗

\brief Get the mutable pointer to the fixed-width values of an array allocated by PreallocateFixedWidthArrayData. \pre mutable_array->offset and the offset of child array (if it's a FixedSizeList) MUST be 0 (recursively). \pre IsFixedWidthLike(ArraySpan(mutable_array)) or the more restrictive is_fixed_width(*mutable_array->type) MUST be true \return The mutable pointer to the fixed-width byte blo

Source from the content-addressed store, hash-verified

213/// \return The mutable pointer to the fixed-width byte blocks of the array. If
214/// pre-conditions are not satisfied, the return values is undefined.
215uint8_t* MutableFixedWidthValuesPointer(ArrayData* mutable_array) {
216 auto* array = mutable_array;
217 auto type_id = array->type->id();
218 while (type_id == Type::FIXED_SIZE_LIST) {
219 DCHECK_EQ(array->offset, 0);
220 DCHECK_EQ(array->child_data.size(), 1) << array->type->ToString(true) << " part of "
221 << mutable_array->type->ToString(true);
222 array = array->child_data[0].get();
223 type_id = array->type->id();
224 }
225 DCHECK_EQ(mutable_array->offset, 0);
226 // BOOL is allowed here only because the offset is expected to be 0,
227 // so the byte-aligned pointer also points to the first *bit* of the buffer.
228 DCHECK(is_fixed_width(type_id));
229 return array->GetMutableValues<uint8_t>(1, 0);
230}
231
232} // namespace arrow::util

Callers 2

PrimitiveFilterImplMethod · 0.85
ExecMethod · 0.85

Calls 5

is_fixed_widthFunction · 0.85
idMethod · 0.45
sizeMethod · 0.45
ToStringMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected