pub fn pyarrow_struct_optional(column: &str) -> Array {
    let validity = vec![false, true, true, true, true, true, true, true, true, true];

    let string = vec![
        Some("Hello".to_string()),
        None,
        Some("aa".to_string()),
        Some("".to_string()),
        None,
        Some("abc".to_string()),
        None,
        None,
        Some("def".to_string()),
        Some("aaa".to_string()),
    ]
    .into_iter()
    .map(|s| s.map(|s| s.as_bytes().to_vec()))
    .collect::<Vec<_>>();
    let boolean = vec![
        Some(true),
        None,
        Some(false),
        Some(false),
        None,
        Some(true),
        None,
        None,
        Some(true),
        Some(true),
    ];

    match column {
        "struct_nullable" => {
            let string = string
                .iter()
                .zip(validity.iter())
                .map(|(item, valid)| if *valid { item.clone() } else { None })
                .collect();
            let boolean = boolean
                .iter()
                .zip(validity.iter())
                .map(|(item, valid)| if *valid { *item } else { None })
                .collect();
            Array::Struct(
                vec![Array::Binary(string), Array::Boolean(boolean)],
                validity,
            )
        }
        "struct_required" => Array::Struct(
            vec![Array::Binary(string), Array::Boolean(boolean)],
            vec![true; validity.len()],
        ),
        _ => unreachable!(),
    }
}
// these values match the values in `integration`
these values match the values in `integration`
these values match the values in ` integration `
pub fn pyarrow_struct_optional(column: &str) -> Array {
    let validity = vec![false, true, true, true, true, true, true, true, true, true];
    let string = vec![
        Some("Hello".to_string()),
        None,
        Some("aa".to_string()),
        Some("".to_string()),
        None,
        Some("abc".to_string()),
        None,
        None,
        Some("def".to_string()),
        Some("aaa".to_string()),
    ]
    .into_iter()
    .map(|s| s.map(|s| s.as_bytes().to_vec()))
    .collect::<Vec<_>>();
    let boolean = vec![
        Some(true),
        None,
        Some(false),
        Some(false),
        None,
        Some(true),
        None,
        None,
        Some(true),
        Some(true),
    ];
    match column {
        "struct_nullable" => {
            let string = string
                .iter()
                .zip(validity.iter())
                .map(|(item, valid)| if *valid { item.clone() } else { None })
                .collect();
            let boolean = boolean
                .iter()
                .zip(validity.iter())
                .map(|(item, valid)| if *valid { *item } else { None })
                .collect();
            Array::Struct(
                vec![Array::Binary(string), Array::Boolean(boolean)],
                validity,
            )
        }
        "struct_required" => Array::Struct(
            vec![Array::Binary(string), Array::Boolean(boolean)],
            vec![true; validity.len()],
        ),
        _ => unreachable!(),
    }
}
pub fn pyarrow_struct_optional ( column : & str ) -> Array { let validity = vec ! [ false true true true true true true true true true ] ; let string = vec ! [ Some ( " " to_string ( ) ) None Some ( " " to_string ( ) ) Some ( " " to_string ( ) ) None Some ( " " to_string ( ) ) None None Some ( " " to_string ( ) ) Some ( " " to_string ( ) ) ] . into_iter ( ) . map ( | s | s . map ( | s | s . as_bytes ( ) . to_vec ( ) ) ) . collect :: < Vec < _ > > ( ) ; let boolean = vec ! [ Some ( true ) None Some ( false ) Some ( false ) None Some ( true ) None None Some ( true ) Some ( true ) ] ; match column { " " => { let string = string . iter ( ) . zip ( validity . iter ( ) ) . map ( | ( item , valid ) | if * valid { item . clone ( ) } else { None } ) . collect ( ) ; let boolean = boolean . iter ( ) . zip ( validity . iter ( ) ) . map ( | ( item , valid ) | if * valid { * item } else { None } ) . collect ( ) ; Array :: Struct ( vec ! [ Array Binary ( string ) Array Boolean ( boolean ) ] , validity , ) } " " => Array :: Struct ( vec ! [ Array Binary ( string ) Array Boolean ( boolean ) ] , vec ! [ true validity len ( ) ] , ) , _ => unreachable ! ( ) , } }
these values match the values in `integration`
these values match the values in ` integration `
column
&str