Rich-T-kid commented on code in PR #10661:
URL: https://github.com/apache/arrow-rs/pull/10661#discussion_r3769302862


##########
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:
   nit: what are your thoughts on returning both fields in one method and 
allowing callers to determine what they want to use?
   
   ```suggestion
       pub fn run_end_fields(&self) -> (&FieldRef,&FieldRef) {
           match &self.data_type {
               DataType::RunEndEncoded(r, v) => (r,v),
               _ => unreachable!(),
           }
       }
   ```



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