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

Function IsFixedWidthLike

cpp/src/arrow/util/fixed_width_internal.h:198–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196/// restrict the types that are considered fixed-width
197template <class ExtraPred>
198inline bool IsFixedWidthLike(const ArraySpan& source, bool force_null_count,
199 ExtraPred extra_predicate) {
200 const auto* type = source.type;
201 // BOOL is considered fixed-width if not nested under FIXED_SIZE_LIST.
202 if (is_fixed_width(type->id()) && extra_predicate(*type)) {
203 return true;
204 }
205 if (type->id() == Type::FIXED_SIZE_LIST) {
206 // All the inner arrays must not contain any nulls.
207 const auto* values = &source.child_data[0];
208 while ((force_null_count ? values->GetNullCount() : values->null_count) == 0) {
209 type = values->type;
210 if (type->id() == Type::FIXED_SIZE_LIST) {
211 values = &values->child_data[0];
212 continue;
213 }
214 return is_fixed_width(type->id()) && extra_predicate(*type);
215 }
216 }
217 return false;
218}
219
220/// \brief Get the fixed-width in bytes of a type if it is a fixed-width like
221/// type, but not BOOL.

Callers 5

TEST_FFunction · 0.70
PrimitiveFilterExecFunction · 0.50
FixedWidthTakeExecFunction · 0.50
FSLFilterExecFunction · 0.50
FSLTakeExecFunction · 0.50

Calls 3

is_fixed_widthFunction · 0.85
GetNullCountMethod · 0.80
idMethod · 0.45

Tested by 1

TEST_FFunction · 0.56