Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions datafusion/physical-plan/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ pub struct MemoryStream {
projection: Option<Vec<usize>>,
/// Index into the data
index: usize,
/// The remaining number of rows to return
/// The remaining number of rows to return. If None, all rows are returned
fetch: Option<usize>,
}

Expand Down Expand Up @@ -778,11 +778,9 @@ impl Stream for MemoryStream {
None => batch.clone(),
};

if self.fetch.is_none() {
let Some(&fetch) = self.fetch.as_ref() else {
return Poll::Ready(Some(Ok(batch)));
}

let fetch = self.fetch.unwrap();
};
if fetch == 0 {
return Poll::Ready(None);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ statement ok
drop table test_substr_base;

statement ok
drop table test_datetime_base;
drop table test_datetime_base;
2 changes: 1 addition & 1 deletion datafusion/sqllogictest/test_files/string/large_string.slt
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ statement ok
drop table test_substr_base;

statement ok
drop table test_datetime_base;
drop table test_datetime_base;