(batch_id: usize)
| 413 | } |
| 414 | |
| 415 | fn flat_batch(batch_id: usize) -> RecordBatch { |
| 416 | let schema = flat_schema(); |
| 417 | let len = WRITE_RECORD_BATCH_SIZE; |
| 418 | |
| 419 | let base_id = (batch_id * len) as i32; |
| 420 | let id_values: Vec<i32> = (0..len).map(|i| base_id + i as i32).collect(); |
| 421 | let id_array = Arc::new(Int32Array::from(id_values.clone())); |
| 422 | let small_int_array = Arc::new(Int32Array::from(id_values)); |
| 423 | |
| 424 | let large_string: String = "x".repeat(LARGE_STRING_LEN); |
| 425 | let mut string_builder = StringBuilder::new(); |
| 426 | for _ in 0..len { |
| 427 | string_builder.append_value(&large_string); |
| 428 | } |
| 429 | let large_string_array = Arc::new(string_builder.finish()); |
| 430 | |
| 431 | RecordBatch::try_new( |
| 432 | schema, |
| 433 | vec![id_array, large_string_array as ArrayRef, small_int_array], |
| 434 | ) |
| 435 | .unwrap() |
| 436 | } |
| 437 | |
| 438 | /// Compare selecting a small field from a flat (top-level) schema vs from |
| 439 | /// inside a struct. Both files contain the same logical data — the only |
nothing calls this directly
no test coverage detected
searching dependent graphs…