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

Method next

datafusion/core/src/datasource/file_format/csv.rs:1285–1297  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

1283 type Item = Bytes;
1284
1285 fn next(&mut self) -> Option<Self::Item> {
1286 // Return `batch_size` rows per batch:
1287 let mut buffer = Vec::new();
1288 for _ in 0..self.batch_size {
1289 if self.offset >= self.line_count {
1290 break;
1291 }
1292 buffer.extend_from_slice(&csv_line(self.offset));
1293 self.offset += 1;
1294 }
1295
1296 (!buffer.is_empty()).then(|| buffer.into())
1297 }
1298 }
1299
1300 fn csv_expected_batch(schema: SchemaRef, line_count: usize) -> Result<RecordBatch> {

Callers 15

criterion_benchmarkFunction · 0.45
runMethod · 0.45
test_with_projectionFunction · 0.45
test_without_projectionFunction · 0.45
test_merged_schemaFunction · 0.45
extract_countFunction · 0.45
get_writtenFunction · 0.45

Calls 4

newFunction · 0.85
csv_lineFunction · 0.85
is_emptyMethod · 0.45
intoMethod · 0.45