MCPcopy Create free account
hub / github.com/apache/arrow-rs / logical_len

Method logical_len

arrow-array/src/array/run_array.rs:103–109  ·  view source on GitHub ↗

Calculates the logical length of the array encoded by treating the `run_ends` array as if it were a [`RunEndBuffer`].

(run_ends: &PrimitiveArray<R>)

Source from the content-addressed store, hash-verified

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 ///

Callers

nothing calls this directly

Calls 3

as_usizeMethod · 0.80
lenMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected