alamb commented on code in PR #10110:
URL: https://github.com/apache/arrow-rs/pull/10110#discussion_r3402944600


##########
arrow-array/src/array/struct_array.rs:
##########
@@ -319,12 +319,25 @@ impl StructArray {
     ///
     /// Note: A schema can currently have duplicate field names, in which case
     /// the first field will always be selected.
-    /// This issue will be addressed in 
[ARROW-11178](https://issues.apache.org/jira/browse/ARROW-11178)
+    /// This issue will be addressed in 
[#9205](https://github.com/apache/arrow-rs/issues/9205)
     pub fn column_by_name(&self, column_name: &str) -> Option<&ArrayRef> {
-        self.column_names()
-            .iter()
-            .position(|c| c == &column_name)
-            .map(|pos| self.column(pos))
+        self.fields()
+            .find(column_name)
+            .map(|(pos, _)| self.column(pos))
+    }
+
+    /// Returns the [`FieldRef`] at `pos`.

Review Comment:
   nice



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