Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
downcast_array in datafusion::common::arrow::array - Rust
[go: Go Back, main page]

Function downcast_array

Source
pub fn downcast_array<T>(array: &dyn Array) -> T
where T: From<ArrayData>,
Expand description

Downcasts a dyn Array to a concrete type

struct ConcreteBatch {
    col1: Int32Array,
    col2: BooleanArray,
    col3: StringArray,
}

impl ConcreteBatch {
    fn new(batch: &RecordBatch) -> Self {
        Self {
            col1: downcast_array(batch.column(0).as_ref()),
            col2: downcast_array(batch.column(1).as_ref()),
            col3: downcast_array(batch.column(2).as_ref()),
        }
    }
}

ยงPanics

Panics if array is not of the correct data type