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

Method next

datafusion/datasource/src/decoder.rs:109–133  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

107 }
108
109 fn next(&mut self) -> Result<DeserializerOutput, ArrowError> {
110 while let Some(buffered) = self.buffered_queue.front_mut() {
111 let decoded = self.decoder.decode(buffered)?;
112 buffered.advance(decoded);
113
114 if buffered.is_empty() {
115 self.buffered_queue.pop_front();
116 }
117
118 // Flush when the stream ends or batch size is reached
119 // Certain implementations can flush early
120 if decoded == 0 || self.decoder.can_flush_early() {
121 return match self.decoder.flush() {
122 Ok(Some(batch)) => Ok(DeserializerOutput::RecordBatch(batch)),
123 Ok(None) => continue,
124 Err(e) => Err(e),
125 };
126 }
127 }
128 if self.finalized {
129 Ok(DeserializerOutput::InputExhausted)
130 } else {
131 Ok(DeserializerOutput::RequiresMoreData)
132 }
133 }
134
135 fn finish(&mut self) {
136 self.finalized = true;

Callers 15

containsMethod · 0.45
find_first_newlineFunction · 0.45
deserialize_streamFunction · 0.45
write_allMethod · 0.45
exec_with_limitFunction · 0.45
runMethod · 0.45
row_count_demuxerFunction · 0.45
openMethod · 0.45
plan_to_jsonFunction · 0.45

Calls 6

pop_frontMethod · 0.80
decodeMethod · 0.45
advanceMethod · 0.45
is_emptyMethod · 0.45
can_flush_earlyMethod · 0.45
flushMethod · 0.45