fn convert_array_datetime()

in azure-kusto-data/src/arrow.rs [25:38]


fn convert_array_datetime(values: Vec<Value>) -> Result<ArrayRef> {
    let dates: Vec<String> = serde_json::from_value(Value::Array(values))?;
    let timestamps = dates
        .into_iter()
        .map(|d| {
            KustoDateTime::from_str(&d)
                .ok()
                .map(|d| d.unix_timestamp_nanos())
                .and_then(|n| n.try_into().ok())
        })
        .collect::<Vec<Option<i64>>>();
    let dates_array = Arc::new(TimestampNanosecondArray::from(timestamps));
    Ok(dates_array)
}