Struct arrow::array::StructArray[][src]

pub struct StructArray { /* fields omitted */ }
Expand description

A nested array type where each child (called field) is represented by a separate array.

Implementations

impl StructArray[src]

pub fn column(&self, pos: usize) -> &ArrayRef[src]

Returns the field at pos.

pub fn num_columns(&self) -> usize[src]

Return the number of fields in this struct array

pub fn columns(&self) -> Vec<&ArrayRef>[src]

Returns the fields of the struct array

pub fn columns_ref(&self) -> Vec<ArrayRef>[src]

Returns child array refs of the struct array

pub fn column_names(&self) -> Vec<&str>[src]

Return field names in this struct array

pub fn column_by_name(&self, column_name: &str) -> Option<&ArrayRef>[src]

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

Trait Implementations

impl Array for StructArray[src]

fn len(&self) -> usize[src]

Returns the length (i.e., number of elements) of this array

fn get_buffer_memory_size(&self) -> usize[src]

Returns the total number of bytes of memory occupied by the buffers owned by this StructArray.

fn get_array_memory_size(&self) -> usize[src]

Returns the total number of bytes of memory occupied physically by this StructArray.

fn as_any(&self) -> &dyn Any[src]

Returns the array as Any so that it can be downcasted to a specific implementation. Read more

fn data(&self) -> &ArrayData[src]

Returns a reference to the underlying data of this array.

fn data_ref(&self) -> &ArrayData[src]

Returns a reference-counted pointer to the underlying data of this array.

fn data_type(&self) -> &DataType[src]

Returns a reference to the DataType of this array. Read more

fn slice(&self, offset: usize, length: usize) -> ArrayRef[src]

Returns a zero-copy slice of this array with the indicated offset and length. Read more

fn is_empty(&self) -> bool[src]

Returns whether this array is empty. Read more

fn offset(&self) -> usize[src]

Returns the offset into the underlying data used by this array(-slice). Note that the underlying data can be shared by many arrays. This defaults to 0. Read more

fn is_null(&self, index: usize) -> bool[src]

Returns whether the element at index is null. When using this function on a slice, the index is relative to the slice. Read more

fn is_valid(&self, index: usize) -> bool[src]

Returns whether the element at index is not null. When using this function on a slice, the index is relative to the slice. Read more

fn null_count(&self) -> usize[src]

Returns the total number of null values in this array. Read more

fn to_raw(&self) -> Result<(*const FFI_ArrowArray, *const FFI_ArrowSchema)>[src]

returns two pointers that represent this array in the C Data Interface (FFI)

impl Debug for StructArray[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl From<&'_ StructArray> for RecordBatch[src]

fn from(struct_array: &StructArray) -> Self[src]

Create a record batch from struct array, where each field of the StructArray becomes a Field in the schema.

This currently does not flatten and nested struct types

impl From<(Vec<(Field, Arc<dyn Array + 'static>), Global>, Buffer)> for StructArray[src]

fn from(pair: (Vec<(Field, ArrayRef)>, Buffer)) -> Self[src]

Performs the conversion.

impl From<ArrayData> for StructArray[src]

fn from(data: ArrayData) -> Self[src]

Performs the conversion.

impl From<RecordBatch> for StructArray[src]

fn from(batch: RecordBatch) -> Self[src]

Performs the conversion.

impl From<Vec<(Field, Arc<dyn Array + 'static>), Global>> for StructArray[src]

fn from(v: Vec<(Field, ArrayRef)>) -> Self[src]

Performs the conversion.

impl JsonEqual for StructArray[src]

fn equals_json(&self, json: &[&Value]) -> bool[src]

Checks whether arrow array equals to json array.

fn equals_json_values(&self, json: &[Value]) -> bool[src]

Checks whether arrow array equals to json array.

impl PartialEq<StructArray> for StructArray[src]

fn eq(&self, other: &Self) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<Value> for StructArray[src]

fn eq(&self, json: &Value) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl TryFrom<Vec<(&'_ str, Arc<dyn Array + 'static>), Global>> for StructArray[src]

fn try_from(values: Vec<(&str, ArrayRef)>) -> Result<Self>[src]

builds a StructArray from a vector of names and arrays. This errors if the values have a different length. An entry is set to Null when all values are null.

type Error = ArrowError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V