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

Method column_by_name

arrow-array/src/array/struct_array.rs:323–328  ·  view source on GitHub ↗

Return child array whose field name equals to column_name 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)

(&self, column_name: &str)

Source from the content-addressed store, hash-verified

321 /// the first field will always be selected.
322 /// This issue will be addressed in [ARROW-11178](https://issues.apache.org/jira/browse/ARROW-11178)
323 pub fn column_by_name(&self, column_name: &str) -> Option<&ArrayRef> {
324 self.column_names()
325 .iter()
326 .position(|c| c == &column_name)
327 .map(|pos| self.column(pos))
328 }
329
330 /// Returns a zero-copy slice of this array with the indicated offset and length.
331 pub fn slice(&self, offset: usize, len: usize) -> Self {

Callers 1

indexMethod · 0.45

Calls 4

positionMethod · 0.80
column_namesMethod · 0.80
iterMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected