emilk commented on code in PR #10661:
URL: https://github.com/apache/arrow-rs/pull/10661#discussion_r3773139588


##########
arrow-array/src/array/run_array.rs:
##########
@@ -206,6 +206,22 @@ impl<R: RunEndIndexType> RunArray<R> {
         (self.data_type, self.run_ends, self.values)
     }
 
+    /// The field that describes the run ends of this array.
+    pub fn run_ends_field(&self) -> &FieldRef {
+        match &self.data_type {
+            DataType::RunEndEncoded(f, _) => f,
+            _ => unreachable!(),
+        }
+    }

Review Comment:
   The benefit of having two functions is that we have _names_ for each of the 
fields, instead of relying on docs explaining which order they are returned in.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to