Creates a UInt64Array of 8 byte integers with input_rows rows `max_flight_data_size_bytes` pieces and verifies the row counts in those pieces
(
num_input_rows: u64,
max_flight_data_size_bytes: usize,
expected_sizes: Vec<usize>,
)
| 1881 | /// `max_flight_data_size_bytes` pieces and verifies the row counts in |
| 1882 | /// those pieces |
| 1883 | fn verify_split( |
| 1884 | num_input_rows: u64, |
| 1885 | max_flight_data_size_bytes: usize, |
| 1886 | expected_sizes: Vec<usize>, |
| 1887 | ) { |
| 1888 | let array: UInt64Array = (0..num_input_rows).collect(); |
| 1889 | |
| 1890 | let batch = RecordBatch::try_from_iter(vec![("a", Arc::new(array) as ArrayRef)]) |
| 1891 | .expect("cannot create record batch"); |
| 1892 | |
| 1893 | let input_rows = batch.num_rows(); |
| 1894 | |
| 1895 | let split = split_batch_for_grpc_response(batch.clone(), max_flight_data_size_bytes); |
| 1896 | let sizes: Vec<_> = split.iter().map(RecordBatch::num_rows).collect(); |
| 1897 | let output_rows: usize = sizes.iter().sum(); |
| 1898 | |
| 1899 | assert_eq!(sizes, expected_sizes, "mismatch for {batch:?}"); |
| 1900 | assert_eq!(input_rows, output_rows, "mismatch for {batch:?}"); |
| 1901 | } |
| 1902 | |
| 1903 | // test sending record batches |
| 1904 | // test sending record batches with multiple different dictionaries |