| 62 | } |
| 63 | |
| 64 | int64_t FixedWidthInBytes(const DataType& type) { |
| 65 | auto type_id = type.id(); |
| 66 | if (is_fixed_width(type_id)) { |
| 67 | const int32_t num_bits = type.bit_width(); |
| 68 | return (type_id == Type::BOOL) ? -1 : num_bits / 8; |
| 69 | } |
| 70 | if (type_id == Type::FIXED_SIZE_LIST) { |
| 71 | auto& fsl = ::arrow::internal::checked_cast<const FixedSizeListType&>(type); |
| 72 | return FixedWidthInBytesFallback(fsl); |
| 73 | } |
| 74 | return -1; |
| 75 | } |
| 76 | |
| 77 | static int64_t FixedWidthInBitsFallback(const FixedSizeListType& fixed_size_list_type) { |
| 78 | auto* fsl = &fixed_size_list_type; |