| 75 | } |
| 76 | |
| 77 | static 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 | |
| 98 | int64_t FixedWidthInBits(const DataType& type) { |
| 99 | auto type_id = type.id(); |
no test coverage detected