Type Definition arrow::array::ListArray

source · []
pub type ListArray = GenericListArray<i32>;
Expand description

A list array where each element is a variable-sized sequence of values with the same type whose memory offsets between elements are represented by a i32.

Example

let data = vec![
   Some(vec![]),
   None,
   Some(vec![Some(3), None, Some(5), Some(19)]),
   Some(vec![Some(6), Some(7)]),
];
let list_array = ListArray::from_iter_primitive::<Int32Type, _, _>(data);

assert_eq!(false, list_array.is_valid(1));

let list0 = list_array.value(0);
let list2 = list_array.value(2);
let list3 = list_array.value(3);

assert_eq!(&[] as &[i32], list0.as_any().downcast_ref::<Int32Array>().unwrap().values());
assert_eq!(false, list2.as_any().downcast_ref::<Int32Array>().unwrap().is_valid(1));
assert_eq!(&[6, 7], list3.as_any().downcast_ref::<Int32Array>().unwrap().values());