()
| 97 | |
| 98 | #[tokio::test] |
| 99 | async fn read_small_batches() -> Result<()> { |
| 100 | let config = SessionConfig::new().with_batch_size(2); |
| 101 | let session_ctx = SessionContext::new_with_config(config); |
| 102 | let state = session_ctx.state(); |
| 103 | let task_ctx = state.task_ctx(); |
| 104 | let projection = None; |
| 105 | let exec = get_exec(&state, projection, None).await?; |
| 106 | let stream = exec.execute(0, task_ctx)?; |
| 107 | |
| 108 | let tt_batches: i32 = stream |
| 109 | .map(|batch| { |
| 110 | let batch = batch.unwrap(); |
| 111 | assert_eq!(4, batch.num_columns()); |
| 112 | assert_eq!(2, batch.num_rows()); |
| 113 | }) |
| 114 | .fold(0, |acc, _| async move { acc + 1i32 }) |
| 115 | .await; |
| 116 | |
| 117 | assert_eq!(tt_batches, 6 /* 12/2 */); |
| 118 | |
| 119 | // test metadata |
| 120 | assert_eq!(exec.partition_statistics(None)?.num_rows, Precision::Absent); |
| 121 | assert_eq!( |
| 122 | exec.partition_statistics(None)?.total_byte_size, |
| 123 | Precision::Absent |
| 124 | ); |
| 125 | |
| 126 | Ok(()) |
| 127 | } |
| 128 | |
| 129 | #[tokio::test] |
| 130 | async fn read_limit() -> Result<()> { |
nothing calls this directly
no test coverage detected
searching dependent graphs…