(
mut self: std::pin::Pin<&mut Self>,
_: &mut Context<'_>,
)
| 91 | type Item = Result<RecordBatch>; |
| 92 | |
| 93 | fn poll_next( |
| 94 | mut self: std::pin::Pin<&mut Self>, |
| 95 | _: &mut Context<'_>, |
| 96 | ) -> Poll<Option<Self::Item>> { |
| 97 | if self.index >= self.data.len() { |
| 98 | return Poll::Ready(None); |
| 99 | } |
| 100 | self.index += 1; |
| 101 | let batch = &self.data[self.index - 1]; |
| 102 | // return just the columns requested |
| 103 | let batch = match self.projection.as_ref() { |
| 104 | Some(columns) => batch.project(columns)?, |
| 105 | None => batch.clone(), |
| 106 | }; |
| 107 | |
| 108 | let Some(&fetch) = self.fetch.as_ref() else { |
| 109 | return Poll::Ready(Some(Ok(batch))); |
| 110 | }; |
| 111 | if fetch == 0 { |
| 112 | return Poll::Ready(None); |
| 113 | } |
| 114 | |
| 115 | let batch = if batch.num_rows() > fetch { |
| 116 | batch.slice(0, fetch) |
| 117 | } else { |
| 118 | batch |
| 119 | }; |
| 120 | self.fetch = Some(fetch - batch.num_rows()); |
| 121 | Poll::Ready(Some(Ok(batch))) |
| 122 | } |
| 123 | |
| 124 | fn size_hint(&self) -> (usize, Option<usize>) { |
| 125 | (self.data.len(), Some(self.data.len())) |
nothing calls this directly
no test coverage detected