Calculates the logical length of the array encoded by treating the `run_ends` array as if it were a [`RunEndBuffer`].
(run_ends: &PrimitiveArray<R>)
| 101 | /// Calculates the logical length of the array encoded by treating the `run_ends` |
| 102 | /// array as if it were a [`RunEndBuffer`]. |
| 103 | pub fn logical_len(run_ends: &PrimitiveArray<R>) -> usize { |
| 104 | let len = run_ends.len(); |
| 105 | if len == 0 { |
| 106 | return 0; |
| 107 | } |
| 108 | run_ends.value(len - 1).as_usize() |
| 109 | } |
| 110 | |
| 111 | /// Attempts to create a [`RunArray`] using the given `run_ends` and `values`. |
| 112 | /// |