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

Function FixedWidthInBitsFallback

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

Source from the content-addressed store, hash-verified

75}
76
77static int64_t FixedWidthInBitsFallback(const FixedSizeListType& fixed_size_list_type) {
78 auto* fsl = &fixed_size_list_type;
79 int64_t list_size = fsl->list_size();
80 for (auto type = fsl->value_type().get();;) {
81 auto type_id = type->id();
82 if (type_id == Type::FIXED_SIZE_LIST) {
83 fsl = checked_cast<const FixedSizeListType*>(type);
84 list_size *= fsl->list_size();
85 type = fsl->value_type().get();
86 continue;
87 }
88 if (is_fixed_width(type_id)) {
89 const int64_t flat_bit_width = list_size * type->bit_width();
90 DCHECK_GE(flat_bit_width, 0);
91 return flat_bit_width;
92 }
93 break;
94 }
95 return -1;
96}
97
98int64_t FixedWidthInBits(const DataType& type) {
99 auto type_id = type.id();

Callers 1

FixedWidthInBitsFunction · 0.85

Calls 6

is_fixed_widthFunction · 0.85
list_sizeMethod · 0.45
getMethod · 0.45
value_typeMethod · 0.45
idMethod · 0.45
bit_widthMethod · 0.45

Tested by

no test coverage detected