fn create_primitive<T>(size: usize, null_density: f32) -> ArrayRef
where
    T: ArrowPrimitiveType,
    Standard: Distribution<T::Native>,
    PrimitiveArray<T>: std::convert::From<Vec<T::Native>>,
{
    let mut rng = seedable_rng();

    let array: PrimitiveArray<T> = seedable_rng()
        .sample_iter(&Standard)
        .take(size)
        .map(|value| {
            let x = rng.gen::<f32>();
            if x < null_density {
                Some(value)
            } else {
                None
            }
        })
        .collect();

    Arc::new(array) as ArrayRef
}
// cast array from specified primitive array type to desired data type
cast array from specified primitive array type to desired data type
cast array from specified primitive array type to desired data type
fn create_primitive<T>(size: usize, null_density: f32) -> ArrayRef
where
    T: ArrowPrimitiveType,
    Standard: Distribution<T::Native>,
    PrimitiveArray<T>: std::convert::From<Vec<T::Native>>,
{
    let mut rng = seedable_rng();
    let array: PrimitiveArray<T> = seedable_rng()
        .sample_iter(&Standard)
        .take(size)
        .map(|value| {
            let x = rng.gen::<f32>();
            if x < null_density {
                Some(value)
            } else {
                None
            }
        })
        .collect();
    Arc::new(array) as ArrayRef
}
fn create_primitive < T > ( size : usize , null_density : f32 ) -> ArrayRef where T : ArrowPrimitiveType , Standard : Distribution < T :: Native > , PrimitiveArray < T > : std :: convert :: From < Vec < T :: Native > > , { let mut rng = seedable_rng ( ) ; let array : PrimitiveArray < T > = seedable_rng ( ) . sample_iter ( & Standard ) . take ( size ) . map ( | value | { let x = rng . gen :: < f32 > ( ) ; if x < null_density { Some ( value ) } else { None } } ) . collect ( ) ; Arc :: new ( array ) as ArrayRef }
cast array from specified primitive array type to desired data type
cast array from specified primitive array type to desired data type
size
usize
null_density
f32
size
usize
null_density
f32