MCPcopy Create free account
hub / github.com/apache/datafusion / poll_next

Method poll_next

datafusion/physical-plan/src/recursive_query.rs:415–445  ·  view source on GitHub ↗
(
        mut self: std::pin::Pin<&mut Self>,
        cx: &mut Context<'_>,
    )

Source from the content-addressed store, hash-verified

413 type Item = Result<RecordBatch>;
414
415 fn poll_next(
416 mut self: std::pin::Pin<&mut Self>,
417 cx: &mut Context<'_>,
418 ) -> Poll<Option<Self::Item>> {
419 if let Some(static_stream) = &mut self.static_stream {
420 // While the static term's stream is available, we'll be forwarding the batches from it (also
421 // saving them for the initial iteration of the recursive term).
422 let batch_result = ready!(static_stream.poll_next_unpin(cx));
423 match &batch_result {
424 None => {
425 // Once this is done, we can start running the setup for the recursive term.
426 self.static_stream = None;
427 self.poll_next_iteration(cx)
428 }
429 Some(Ok(batch)) => self.push_batch(batch.clone()),
430 _ => Poll::Ready(batch_result),
431 }
432 } else if let Some(recursive_stream) = &mut self.recursive_stream {
433 let batch_result = ready!(recursive_stream.poll_next_unpin(cx));
434 match batch_result {
435 None => {
436 self.recursive_stream = None;
437 self.poll_next_iteration(cx)
438 }
439 Some(Ok(batch)) => self.push_batch(batch),
440 _ => Poll::Ready(batch_result),
441 }
442 } else {
443 Poll::Ready(None)
444 }
445 }
446}
447
448impl RecordBatchStream for RecursiveQueryStream {

Callers 1

poll_next_iterationMethod · 0.45

Calls 3

poll_next_iterationMethod · 0.80
push_batchMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected