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

Method VisitFixedWidthArray

cpp/src/arrow/util/byte_size.cc:135–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134
135 Status VisitFixedWidthArray(const Buffer& buffer, const FixedWidthType& type) const {
136 uint64_t data_start = reinterpret_cast<uint64_t>(buffer.data());
137 uint64_t offset_bits = offset * type.bit_width();
138 uint64_t offset_bytes = bit_util::RoundDown(static_cast<int64_t>(offset_bits), 8) / 8;
139 uint64_t end_byte =
140 bit_util::RoundUp(static_cast<int64_t>(offset_bits + (length * type.bit_width())),
141 8) /
142 8;
143 uint64_t length_bytes = (end_byte - offset_bytes);
144 RETURN_NOT_OK(range_starts->Append(data_start));
145 RETURN_NOT_OK(range_offsets->Append(offset_bytes));
146 return range_lengths->Append(length_bytes);
147 }
148
149 Status Visit(const FixedWidthType& type) const {
150 static_assert(sizeof(uint8_t*) <= sizeof(uint64_t),

Callers

nothing calls this directly

Calls 5

RoundDownFunction · 0.85
RoundUpFunction · 0.85
dataMethod · 0.45
bit_widthMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected