fn convert_array_timespan()

in azure-kusto-data/src/arrow.rs [57:68]


fn convert_array_timespan(values: Vec<Value>) -> Result<ArrayRef> {
    let strings: Vec<String> = serde_json::from_value(Value::Array(values))?;
    let durations: Vec<Option<i64>> = strings
        .iter()
        .map(|s| {
            KustoDuration::from_str(s)
                .ok()
                .and_then(|d| i64::try_from(d.whole_nanoseconds()).ok())
        })
        .collect();
    Ok(Arc::new(DurationNanosecondArray::from(durations)))
}