Estimate how many bytes are actually represented by the array; in case the the array slices it's internal buffer, this returns the byte size of that slice but not the byte size of the entire buffer. This is an estimation only as it can estimate higher if null slots are non-zero sized.
(array: &GenericBinaryArray<O>)
| 276 | /// This is an estimation only as it can estimate higher if null slots are non-zero |
| 277 | /// sized. |
| 278 | fn estimate_byte_data_size<O: OffsetSizeTrait>(array: &GenericBinaryArray<O>) -> usize { |
| 279 | let offsets = array.value_offsets(); |
| 280 | // Unwraps are safe as should always have 1 element in offset buffer |
| 281 | let start = *offsets.first().unwrap(); |
| 282 | let end = *offsets.last().unwrap(); |
| 283 | let data_size = end - start; |
| 284 | data_size.as_usize() |
| 285 | } |
| 286 | |
| 287 | fn decode_array(array: &ArrayRef, encoding: Encoding) -> Result<ColumnarValue> { |
| 288 | let array = match array.data_type() { |
searching dependent graphs…