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

Method poll_next

datafusion-examples/examples/relation_planner/table_sample.rs:794–808  ·  view source on GitHub ↗
(
        mut self: Pin<&mut Self>,
        cx: &mut Context<'_>,
    )

Source from the content-addressed store, hash-verified

792 type Item = Result<RecordBatch>;
793
794 fn poll_next(
795 mut self: Pin<&mut Self>,
796 cx: &mut Context<'_>,
797 ) -> Poll<Option<Self::Item>> {
798 match ready!(self.input.poll_next_unpin(cx)) {
799 Some(Ok(batch)) => {
800 let elapsed = self.metrics.elapsed_compute().clone();
801 let _timer = elapsed.timer();
802 let result = self.sampler.sample(&batch);
803 Poll::Ready(Some(result.record_output(&self.metrics)))
804 }
805 Some(Err(e)) => Poll::Ready(Some(Err(e))),
806 None => Poll::Ready(None),
807 }
808 }
809}
810
811impl RecordBatchStream for SampleStream {

Callers

nothing calls this directly

Calls 5

timerMethod · 0.80
record_outputMethod · 0.80
cloneMethod · 0.45
elapsed_computeMethod · 0.45
sampleMethod · 0.45

Tested by

no test coverage detected