| 42 | } |
| 43 | |
| 44 | static 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 | |
| 64 | int64_t FixedWidthInBytes(const DataType& type) { |
| 65 | auto type_id = type.id(); |
no test coverage detected