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

Function FixedWidthInBytesFallback

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

Source from the content-addressed store, hash-verified

42}
43
44static int64_t FixedWidthInBytesFallback(const FixedSizeListType& fixed_size_list_type) {
45 auto* fsl = &fixed_size_list_type;
46 int64_t list_size = fsl->list_size();
47 for (auto type = fsl->value_type().get();;) {
48 if (type->id() == Type::FIXED_SIZE_LIST) {
49 fsl = checked_cast<const FixedSizeListType*>(type);
50 list_size *= fsl->list_size();
51 type = fsl->value_type().get();
52 continue;
53 }
54 if (type->id() != Type::BOOL && is_fixed_width(type->id())) {
55 const int64_t flat_byte_width = list_size * type->byte_width();
56 DCHECK_GE(flat_byte_width, 0);
57 return flat_byte_width;
58 }
59 break;
60 }
61 return -1;
62}
63
64int64_t FixedWidthInBytes(const DataType& type) {
65 auto type_id = type.id();

Callers 1

FixedWidthInBytesFunction · 0.85

Calls 6

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

Tested by

no test coverage detected