(
records: &[Value],
name: &str,
num_rows: usize,
precision: u32,
tz: Option<Arc<str>>,
)
| 370 | } |
| 371 | |
| 372 | fn build_timestamp_column( |
| 373 | records: &[Value], |
| 374 | name: &str, |
| 375 | num_rows: usize, |
| 376 | precision: u32, |
| 377 | tz: Option<Arc<str>>, |
| 378 | ) -> Arc<dyn arrow_array::Array> { |
| 379 | let idx = field_index(records, name); |
| 380 | let values: Vec<Option<i64>> = (0..num_rows) |
| 381 | .map(|i| get_field_at(&records[i], idx).and_then(value_as_i64)) |
| 382 | .collect(); |
| 383 | match precision { |
| 384 | 0..=3 => Arc::new(TimestampMillisecondArray::from(values).with_timezone_opt(tz)), |
| 385 | 4..=6 => Arc::new(TimestampMicrosecondArray::from(values).with_timezone_opt(tz)), |
| 386 | _ => Arc::new(TimestampNanosecondArray::from(values).with_timezone_opt(tz)), |
| 387 | } |
| 388 | } |
| 389 | |
| 390 | fn build_array_column( |
| 391 | records: &[Value], |
no test coverage detected